diff --git a/scripts/seed.ts b/scripts/seed.ts index 0994d75..35ff99f 100644 --- a/scripts/seed.ts +++ b/scripts/seed.ts @@ -3,8 +3,6 @@ import { db } from 'api/src/lib/db' import { hashPassword } from '@redwoodjs/auth-dbauth-api' -const MAX_TITLES = 5 - export default async () => { try { const admin = { @@ -44,9 +42,7 @@ export default async () => { if (!titles) await db.titles.create({ data: { - titles: Array.from({ length: MAX_TITLES }).map( - (_, i) => `a title ${i + 1}` - ), + titles: Array.from({ length: 3 }).map((_, i) => `title ${i + 1}`), }, }) } catch (error) { diff --git a/web/package.json b/web/package.json index f2b11e0..e353037 100644 --- a/web/package.json +++ b/web/package.json @@ -41,8 +41,7 @@ "react": "18.3.1", "react-colorful": "^5.6.1", "react-dom": "18.3.1", - "react-html-parser": "^2.0.2", - "react-typed": "^2.0.12" + "react-html-parser": "^2.0.2" }, "devDependencies": { "@redwoodjs/vite": "8.4.0", diff --git a/web/src/components/Title/Titles/Titles.tsx b/web/src/components/Title/Titles/Titles.tsx index daad259..610b42c 100644 --- a/web/src/components/Title/Titles/Titles.tsx +++ b/web/src/components/Title/Titles/Titles.tsx @@ -1,38 +1,28 @@ -import { ReactTyped } from 'react-typed' - interface TitlesProps { titles: string[] className?: string } -export const Titles = ({ titles, className }: TitlesProps) => { +export const Titles = ({ titles }: TitlesProps) => { const titlesFiltered = titles.filter((title) => title !== '') return ( <> -

- Hey 👋, I'm {`${process.env.FIRST_NAME}`} - {titlesFiltered.length > 0 && ( - <> - ,
- { - if (pos === 0) { - self.stop() - setTimeout(() => self.start(), 2500) - } - }} - /> - - )} -

+ {titlesFiltered.length >= 3 && ( +
+ + {titlesFiltered[0]} + +
+ + {titlesFiltered[1]} + +
+ + {titlesFiltered[2]} + +
+ )} ) } diff --git a/web/src/components/Title/TitlesForm/TitlesForm.tsx b/web/src/components/Title/TitlesForm/TitlesForm.tsx index 5384dbe..b368da4 100644 --- a/web/src/components/Title/TitlesForm/TitlesForm.tsx +++ b/web/src/components/Title/TitlesForm/TitlesForm.tsx @@ -8,8 +8,6 @@ import { Form, Label, Submit, TextField } from '@redwoodjs/forms' import { TypedDocumentNode, useMutation } from '@redwoodjs/web' import { toast } from '@redwoodjs/web/toast' -const MAX_TITLES = 5 - interface TitlesFormProps { titles?: Titles } @@ -25,14 +23,10 @@ const UPDATE_TITLES_MUTATION: TypedDocumentNode = gql` const TitlesForm = ({ titles }: TitlesFormProps) => { const title1ref = useRef(null) - const [preview, setPreview] = useState(false) - const states = [ useState(titles?.titles[0]), useState(titles?.titles[1]), useState(titles?.titles[2]), - useState(titles?.titles[3]), - useState(titles?.titles[4]), ] useEffect(() => title1ref.current?.focus(), []) @@ -56,10 +50,7 @@ const TitlesForm = ({ titles }: TitlesFormProps) => { return (
-

- The first title gets displayed for longer -

- {Array.from({ length: MAX_TITLES }).map((_, i) => ( + {Array.from({ length: 3 }).map((_, i) => ( ))} +
+ + {states[0][0]} + +
+ + {states[1][0]} + +
+ + {states[2][0]} + +
+