Skip to content

Commit

Permalink
lazy load linkify on Read
Browse files Browse the repository at this point in the history
  • Loading branch information
querwurzel committed Nov 7, 2023
1 parent dfedb77 commit 3a9593a
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion frontend/src/api/model/PasteCreateCmd.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

export interface PasteCreateCmd {
export type PasteCreateCmd = {
title?: string
content: string
isEncrypted?: boolean
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/api/model/PasteListView.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

export interface PasteListView {
export type PasteListView = {
id: string
title?: string
sizeInBytes: number
Expand All @@ -8,6 +8,6 @@ export interface PasteListView {
dateOfExpiry?: string
}

export interface PasteList {
export type = PasteList {
pastes: Array<PasteListView>
}
2 changes: 1 addition & 1 deletion frontend/src/api/model/PasteView.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

export interface PasteView {
export type PasteView = {
id: string
title?: string
content: string
Expand Down
10 changes: 7 additions & 3 deletions frontend/src/components/CreatePaste/CreatePaste.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ import {encrypt} from "../../crypto/CryptoUtil";
import {Copy} from '../../assets/Vectors';
import styles from "./createPaste.module.css";

export interface PasteClone {
export type PasteClone = {
title?: string
content: string
}

interface CreatePasteProps {
type CreatePasteProps = {
onCreatePaste: (paste: PasteCreateCmd) => Promise<string>
initialPaste?: PasteClone
}

interface FormModel extends Omit<PasteCreateCmd, "isEncrypted"> {
type FormModel = {
title?: string
content: string
expiry?: 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH' | 'THREE_MONTHS' | 'ONE_YEAR' | 'NEVER'
exposure?: 'PUBLIC' | 'UNLISTED' | 'ONCE'
password: string
}

Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {JSX} from 'solid-js';

const Footer: () => JSX.Element = () => {

return (
<div>
<span>© 2023</span>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {A} from '@solidjs/router';
import {JSX} from 'solid-js';

const Header: () => JSX.Element = () => {

return (
<div>
<h1><A href={'/'}>BinPastes</A></h1>
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/components/ReadPaste/ReadPaste.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import linkifyElement from 'linkify-element';
import {Component, createEffect, createSignal, JSX, on, Show} from 'solid-js';
import {Component, createEffect, createSignal, JSX, lazy, on, Show} from 'solid-js';
import {PasteView} from '../../api/model/PasteView';
import {decrypt} from '../../crypto/CryptoUtil';
import {relativeDiffLabel, toDateString, toDateTimeString} from '../../datetime/DateTimeUtil';
import {Lock, Unlock, Key, Trash, Copy} from '../../assets/Vectors';
import styles from './readPaste.module.css';

interface ReadPasteProps {
const linkifyElement = lazy(() => import('linkify-element'));

type ReadPasteProps = {
paste: PasteView
onClonePaste: () => void
onDeletePaste: () => void
Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/404.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {A} from '@solidjs/router';
import {JSX} from 'solid-js';

const NotFound: () => JSX.Element = () => {

return (
<div style="margin:1rem">
<h3><i>404</i> Nothing around here :(</h3>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/Search.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {JSX} from 'solid-js';

const Search: () => JSX.Element = () => {

return (
<>
<h2>Search</h2>
Expand Down

0 comments on commit 3a9593a

Please sign in to comment.