From b510154b8de102a21b9056af6477912779b5eebc Mon Sep 17 00:00:00 2001 From: Ian Brighton <66142236+Ian-Bright@users.noreply.github.com> Date: Mon, 15 Jan 2024 13:12:09 -0500 Subject: [PATCH] v0.3 (#26) * add hover effect to toolbar button * implement new color scheme and layout * landing page background image doesn't scroll anymore * fix: add group routes to handle stateful / stateless toolbar layouts * feat: create landing page and force redirect from root route to landing * feat: responsive layout * feat: Show site loading in toolbar * fix: Stop background image on landing page from expanding height of container * fix: resolve build errors due to incorrect image paths * fix: Remove lint warnings * fix: change discover page props to format supported by next13 * feat: :construction: [WIP] Convert landing page from image * chore: :construction: Add ethereum icon + update responsive styles * chore: :package: Add `framer-motion` * feat: :sparkles: Add countdown timer to landing page * feat: Basic navigation menu implemented for v0.3 * feat: Add signed-in options to menu * fix: close menu on route navigation * feat: Add border to navigation menu * style: Run lint * refactor: Remove duplicate gradient * refactor: :iphone: Update responsive design for timer and splash screen * refactor: :iphone: Update responsive styles for splash screen * refactor: :dizzy: Timer animation will now pause on each number * refactor: :dizzy: Update easing function of timer animation * feat: Initial wallet context set up to support web3Auth * refactor: Import links for main menu from siteConfig instead of hardcoding in menu file * feat: update menu with new links * feat: Add menu open/close animation * fix: Remove pointer events from menu while closed * fix: Clean up mobile designs for navigation menu * refactor: Lint code * feat: Web3 auth login status renders necessary links in navigation menu and persists on page refresh * feat: :hammer: Add function to create proxy urls for mix * refactor: :recycle: Add proxyUrl to C4Content type and use it in Discover to display websites * refactor: :recycle: update `fetchMix` to `createProxyUrls` and return the mix with `proxyUrls` added * fix: :label: Add missing type for `createProxyUrls` fn * feat: Web3 auth login working with updated server * fix: Shrink menu size for smaller screens * fix: Change menu options from title case to sentence case * fix: Change sign up / sign in to sentence case * feat: ZeroDev integration * fix: Change custom green color name to avoid overwriting tailwind default * fix: Change custom green color name to avoid overwriting tailwind default * refactor: Rename WalletProvider to AuthProvider * refactor: fix lint warnings * fix: Comment out old navs to allow site to successfully build * feat: Initial site details skeleton * feat: Change xs and sm breakpoints to md * feat: Site details implemented * fix: Stop flex shrink on close icon and add gaps betweem sections of site details * fix: Remove zero dev since it breaks build * feat: Save progress with signer web3 auth signer being passed around app now * feat: Fix site details resizing and remove padding from discover page content * feat: Hide other toolbar popup if one is already open * feat: Like icon filled in when site is liked * fix: User likes now load in when a user signs into the site * feat: Saving progress. Bug exists where duplicate sites are being fetched within mix * fix: Remove 'ecoding not found' warning stack trace * feat: Wireframe set up for submit website redesign * fix: Prevent user likes from being fetched with undefined id * fix: Fix mix index bug * feat: Add like button popover. Set text to 14px because it fixs screen better * refactor: Resolve lint warnings * password(feat): change usePassword by useJWT and make it persistent * like(feat): send data in req.body to backend * likes(fix): remove unused code * tags(feat): send params in req.body * url(feat): send params in req.body * toolbar(fix): spelling * auth(feat): userId is fetch from jwt * receipts(feat): save submitUrl, submitTag and like receipts * feat: Select component almost implemented. Slider almost completed but with a few bugs * fix: :bug: Fix nested button issue and conflicting condition in toolbar * feat: :dizzy: Add animations and transitions to toolbar Menu icon popup and glow, Next button nudge * feat: Correct text line height to reflect figma design * iframe url debouncing working * feat: Slider messaging and functionality complete * feat: Info icon popover added * feat: Select component add and remove props added * feat: Not sure what I just added * feat: Basic styles and browse page layout implemented * refactor: Resolve lint warnings * feat: Add proper toolbar labeling based on route * feat: Background image set for submit website page * feat: save * likes(fix): typescript fix (no like parameter) * likes(fix): popup when you are not logged in. Like otherwise * fix: Clean up messes related to styling * refactor: Resolve lint warnings * feat: initial dashboard design set up * feat: Tags fed in from server and header on browse page made sticky * feat: Merge in feat/submit-website * feat: need to filter by tag on discover page * feat: Add useEffect * feat: Mobile design implemented for submit website * fix: Fix overflow bugs on mobile view * refactor: Resolve lint warnings and move inline styles for slider into tailwind class * feat: Clean up RequireAuth component, add loading state, and allow signin via web3auth through it * refactor: Remove jwt store variables in require auth and replace with signedIn from AuthContext * chore: :package: Update pnpm version * fix: :wheelchair: Add `iframe` title * feat: Discover page now filters videos based on tag query param * fix: Filter tags that have no uses * feat: Mobile designs cleaned up * feat: Disable cache on browse page * refactor: Resolve lint warnings * feat: Displaying user like count, submitted urls, and date of account creation on dashboard * feat: Show provider used to log in and the associated email with the provider should one exist * feat: Update navigation menu to get rid of unused routes * refactor: Resolve lint warnings * feat: Shrink down text label sizes and decrease margins * feat: Add error messaging for all text inputs * fix: Selected tags in select box now overflow and scroll correctly * refactor: Resolve lint warnings * fix: Disable slider when creating new tag * fix: Get frontend to build correctly so netlify preview works * Update app/(discover)/discover/utils.ts Co-authored-by: Y6NDR <19380973+thebeyondr@users.noreply.github.com> * Update app/(stateless-toolbar)/submit-url/components/slider.tsx Co-authored-by: Y6NDR <19380973+thebeyondr@users.noreply.github.com> * refactor: Remove mongo generated variable for website count and instead derive it from length of the url array * fix: Rename error prop in slider to hasError across component * refactor: Rename duplicate tag state variable on submit url page * refactor: Remove unsused imports for TagMap * fix: Center loading text in require auth component * feat: Change primary button color to a channel4-like green. Update social login order * fix: Correct browse page scroll * feat: Landing page transitions to discover at the end of timer countdown * fix: Change height of main content wrapper to not cause scroll on mobile * fix: Change content height unit from svh to dvh * fix: Try adding dvh to height of root layout * fix: Change h-screen to 100dvh * fix: Clean up landing page styles to look good on mobile * feat: Make website url inptut format clearer * feat: Add error highlightin invalid url input on the frontend * fix: Resolve lint warnings and resolve typescript error to allow site to build --------- Co-authored-by: thebeyondr <19380973+thebeyondr@users.noreply.github.com> Co-authored-by: Nico Serrano Co-authored-by: Nico Serrano <38594836+NicoSerranoP@users.noreply.github.com> --- .env.example | 1 + app/(discover)/discover/SiteFrame.tsx | 26 + app/(discover)/discover/page.tsx | 57 + app/(discover)/discover/utils.ts | 79 + app/(discover)/layout.tsx | 31 + app/(stateless-toolbar)/browse/page.tsx | 50 + app/(stateless-toolbar)/dashboard/page.tsx | 75 + app/(stateless-toolbar)/landing/page.tsx | 53 + app/(stateless-toolbar)/layout.tsx | 17 + app/{ => (stateless-toolbar)}/me/page.tsx | 4 +- .../sign-in/page.tsx | 24 +- .../sign-up/page.tsx | 19 +- .../submit-tag/page.tsx | 30 +- .../submit-url/components/SubmitSiteFrame.tsx | 37 + .../submit-url/components/TagSelect.tsx | 93 + .../submit-url/components/slider.tsx | 110 + app/(stateless-toolbar)/submit-url/page.tsx | 412 +++ app/analytics.tsx | 6 +- app/discover/SiteFrame.tsx | 22 - app/discover/layout.tsx | 16 - app/discover/page.tsx | 96 - app/discover/utils.ts | 75 - app/error.tsx | 2 +- app/hooks/useDebounce.tsx | 15 + app/hooks/useMix.ts | 195 -- app/hooks/useMix.tsx | 247 ++ app/hooks/useOutsideAlerter.tsx | 23 + app/layout.tsx | 39 +- app/loading.tsx | 2 +- app/page.tsx | 66 +- app/submit-url/page.tsx | 135 - app/utils.ts | 16 + assets/arrow-right.svg | 23 + assets/bad-url-display.png | Bin 0 -> 4261 bytes assets/browser-icon.svg | 43 + assets/close-border.svg | 4 + assets/empty-heart.svg | 3 + assets/ethereum-stroke.svg | 1 + assets/external-link-arrow.svg | 10 + assets/filled-heart.svg | 3 + assets/submit-url-background.svg | 6 + assets/x-icon.svg | 3 + components/animated-counter.tsx | 55 + components/helper/RequireAuth.tsx | 26 +- components/like-button.tsx | 29 +- components/main-content-wrapper.tsx | 15 + components/main-menu.tsx | 88 + components/site-details.tsx | 67 + components/site-header.tsx | 13 +- components/toolbar.tsx | 154 + components/ui/button.tsx | 13 +- components/ui/tag-list.tsx | 170 +- config/site.ts | 50 +- contexts/AuthContext.tsx | 156 + lib/fonts.ts | 8 + lib/utils.ts | 4 +- package.json | 10 +- pnpm-lock.yaml | 2962 ++++++++++++++++- store/{password.ts => jwt.ts} | 13 +- store/receipts.ts | 28 + tailwind.config.js | 26 + types/index.ts | 4 +- 62 files changed, 5108 insertions(+), 952 deletions(-) create mode 100644 app/(discover)/discover/SiteFrame.tsx create mode 100644 app/(discover)/discover/page.tsx create mode 100644 app/(discover)/discover/utils.ts create mode 100644 app/(discover)/layout.tsx create mode 100644 app/(stateless-toolbar)/browse/page.tsx create mode 100644 app/(stateless-toolbar)/dashboard/page.tsx create mode 100644 app/(stateless-toolbar)/landing/page.tsx create mode 100644 app/(stateless-toolbar)/layout.tsx rename app/{ => (stateless-toolbar)}/me/page.tsx (97%) rename app/{ => (stateless-toolbar)}/sign-in/page.tsx (91%) rename app/{ => (stateless-toolbar)}/sign-up/page.tsx (89%) rename app/{ => (stateless-toolbar)}/submit-tag/page.tsx (69%) create mode 100644 app/(stateless-toolbar)/submit-url/components/SubmitSiteFrame.tsx create mode 100644 app/(stateless-toolbar)/submit-url/components/TagSelect.tsx create mode 100644 app/(stateless-toolbar)/submit-url/components/slider.tsx create mode 100644 app/(stateless-toolbar)/submit-url/page.tsx delete mode 100644 app/discover/SiteFrame.tsx delete mode 100644 app/discover/layout.tsx delete mode 100644 app/discover/page.tsx delete mode 100644 app/discover/utils.ts create mode 100644 app/hooks/useDebounce.tsx delete mode 100644 app/hooks/useMix.ts create mode 100644 app/hooks/useMix.tsx create mode 100644 app/hooks/useOutsideAlerter.tsx delete mode 100644 app/submit-url/page.tsx create mode 100644 app/utils.ts create mode 100644 assets/arrow-right.svg create mode 100644 assets/bad-url-display.png create mode 100644 assets/browser-icon.svg create mode 100644 assets/close-border.svg create mode 100644 assets/empty-heart.svg create mode 100644 assets/ethereum-stroke.svg create mode 100644 assets/external-link-arrow.svg create mode 100644 assets/filled-heart.svg create mode 100644 assets/submit-url-background.svg create mode 100644 assets/x-icon.svg create mode 100644 components/animated-counter.tsx create mode 100644 components/main-content-wrapper.tsx create mode 100644 components/main-menu.tsx create mode 100644 components/site-details.tsx create mode 100644 components/toolbar.tsx create mode 100644 contexts/AuthContext.tsx rename store/{password.ts => jwt.ts} (50%) create mode 100644 store/receipts.ts diff --git a/.env.example b/.env.example index 5ca75d9..aca36d1 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ API_URL='http://localhost:8000/api' +NEXT_PUBLIC_WEB3_AUTH_CLIENT_ID='' NEXT_PUBLIC_API_URL='http://localhost:8000/api' NEXT_PUBLIC_API_LOGIN_SECRET="login to backend" NEXT_PUBLIC_RPC_URL='https://sepolia.infura.io/v3/' diff --git a/app/(discover)/discover/SiteFrame.tsx b/app/(discover)/discover/SiteFrame.tsx new file mode 100644 index 0000000..9521a10 --- /dev/null +++ b/app/(discover)/discover/SiteFrame.tsx @@ -0,0 +1,26 @@ +"use client" + +import React from "react" +import { C4Content } from "@/types" + +interface SiteFrameProps { + site: C4Content | null +} + +const SiteFrame: React.FC = ({ site }) => { + if (!site) return null + + return ( +
+
+