RizkyRajitha / linkin

Linkin is a customizable self hosted link tree platform.
https://linkindemo.vercel.app/
MIT License
78 stars 22 forks source link

Editable linktree width #41

Closed RizkyRajitha closed 2 years ago

RizkyRajitha commented 2 years ago

currently link tree max width is hard corded to 320px

https://github.com/RizkyRajitha/linkin/blob/f01563149814ed9bb987ef5a0e55a7eac56e7670/components/linkinthebiopage.js#L116

current scenario

it should be dynamically changed using the dashboard.

The new form input for width should be under the General tab in the dashboard

tentative workflow

  1. add new form Input with number type
    https://github.com/RizkyRajitha/linkin/blob/f01563149814ed9bb987ef5a0e55a7eac56e7670/components/genaralform.js#L97

and register it with the react-form-hook register method passed pageWidth . (refer the existing implementation)

  1. add new column to the pagedata relation in prisma with name pageWidth and type String? @db.VarChar

https://github.com/RizkyRajitha/linkin/blob/4f982b43707c20e8c55e7a98d5e800cdaae5199e/prisma/schema.prisma#L26 .

  1. migrate the modified prisma schema prisma doc . (when migration dev you will need permission to create databases , if such problem occurs use docker postgres instance ).

  2. destructure the new pageWidth variable and the pass it to the styles
    https://github.com/RizkyRajitha/linkin/blob/f01563149814ed9bb987ef5a0e55a7eac56e7670/components/linkinthebiopage.js#L116

  3. test whether everything works.

rajdama commented 2 years ago

I can do it.

RizkyRajitha commented 2 years ago

hi @rajdama , can you please elaborate more on your comment.