-
Notifications
You must be signed in to change notification settings - Fork 29
Qr code for upload and referral sharing #408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Introduced `StorachaQRCode` component for generating QR codes. - Added `QRButton` component to trigger QR code display. - Integrated QR code display in the referrals page and uploader component. - Updated dependencies in `package.json` for `react-qrcode-logo` and added new SVG logo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this PR has significant formatting issues - I started to identify them but would like you to use your editing tools to take a pass before re-requesting review - most of these errors should be caught automatically by your tools
packages/console/src/qr.tsx
Outdated
value, | ||
size = 256, | ||
ecLevel = 'H', | ||
fgColor = '#f70000', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be the brand color - ideally it should just reference the Tailwind configs:
'hot-red': '#E91315', |
Co-authored-by: Travis Vachon <[email protected]>
Co-authored-by: Travis Vachon <[email protected]>
Co-authored-by: Travis Vachon <[email protected]>
<> | ||
<ReferralsList /> | ||
{referralLink ? ( | ||
{referralLink ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this trailing space
<div className="border border-hot-red rounded-full px-4 py-2 flex flex-row justify-between items-center"> | ||
<div>{referralLink}</div> | ||
<div className="flex flex-row space-x-2"> | ||
<QRButton link={referralLink} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be indented, as should the line below this
|
||
export default function QRButton({ link }: { link: string }) { | ||
const [open, setOpen] = useState(false) | ||
const className = 'h-5 w-5 inline-block mr-1 align-middle' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is only used in one place below, please inline it there
> | ||
<QrCodeIcon | ||
className={`${className} cursor-pointer`} | ||
style={{ marginTop: -4 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't use style
- Tailwind can handle negative margins just fine:
✕ | ||
</button> | ||
|
||
<StorachaQRCode value={link} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be indented
packages/console/src/qr.tsx
Outdated
value, | ||
size = 256, | ||
ecLevel = 'H', | ||
fgColor = '#E91315', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a comment here explaining where this color comes from
This pull request introduces QR code functionality to the console app, allowing users to easily share referral links and uploaded file links via QR codes. The main changes include the addition of a reusable QR code component, integration of QR code buttons in the referrals and uploader pages, and the installation of the necessary QR code library.
QR code feature integration:
StorachaQRCode
React component insrc/qr.tsx
, leveraging thereact-qrcode-logo
library to render branded QR codes.react-qrcode-logo
package and its dependencyqrcode-generator
, updatingpackage.json
andpnpm-lock.yaml
accordingly. [1] [2] [3] [4] [5] [6]UI changes for QR code sharing:
QRButton
component to display referral links as QR codes in a modal, and integrated it into the referrals page (src/app/referrals/page.tsx
). [1] [2] [3] [4]Minor UI and dependency adjustments:
package.json
for consistency. [1] [2]