-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/ratings #16
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: dev
Are you sure you want to change the base?
Feature/ratings #16
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { Rating } from "react-simple-star-rating"; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new component! |
||
|
|
||
| type CardSize = "sm" | "md" | "lg"; | ||
|
|
||
| const sizeStyles = { | ||
| sm: { card: "w-80 p-4 gap-4 min-h-24", text: "text-sm", col: "w-32", starSize: 12 }, | ||
| md: { card: "w-120 p-6 gap-6 min-h-36", text: "text-xl", col: "w-44", starSize: 16 }, | ||
| lg: { card: "w-160 p-8 gap-8 min-h-48", text: "text-2xl", col: "w-56", starSize: 20 }, | ||
| }; | ||
|
|
||
| interface RatingProps { | ||
| rating: number; | ||
| user: string; | ||
| description: string; | ||
| size?: CardSize; | ||
| } | ||
|
|
||
| const RatingCard = ({ rating, user, description, size = "md" }: RatingProps) => { | ||
| const s = sizeStyles[size]; | ||
| return ( | ||
| <div className={`rounded-2xl border flex drop-shadow-2xl items-center ${s.card}`}> | ||
| <div className={`flex flex-col justify-center items-center shrink-0 ${s.col}`}> | ||
| <div className="flex items-center gap-2 shrink-0"> | ||
| <span className="w-3 h-3 rounded-full bg-blue-400 shrink-0" /> | ||
| <span className={`${s.text} break-all`}>{user}</span> | ||
| </div> | ||
| <div className="flex items-center justify-center"> | ||
| <Rating | ||
| size={s.starSize} | ||
| initialValue={rating} | ||
| readonly | ||
| allowFraction | ||
| /> | ||
| </div> | ||
| </div> | ||
| <div className={`font-light leading-snug ${s.text}`}> | ||
| "{description}" | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default RatingCard; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,50 @@ | ||
| import { useEffect, useState } from "react"; | ||
| import PrimaryButton from "./buttons/PrimaryButton"; | ||
|
|
||
| const WaitListJoin = () => { | ||
|
|
||
| interface WaitListJoinProps { | ||
| imageSrc?: string; | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added image src for an optional centy image ;) |
||
|
|
||
| const WaitListJoin = ({ imageSrc }: WaitListJoinProps) => { | ||
| const [, setIsSmallPhone] = useState(false); | ||
|
|
||
| useEffect(() => { | ||
| setIsSmallPhone(window.innerWidth < 376); | ||
| }, []); | ||
|
|
||
| return ( | ||
| <div> | ||
| <div | ||
| className="bg-white w-110 h-60 justify-center relative flex flex-col mx-auto tracking-[5%] | ||
| mb-32 rounded-2xl border-2 border-[#52AEEF] items-center shadow-[15px_15px_0px_#ABD8F6]" > | ||
|
|
||
| <p className="text-center font-semibold text-[37.5px] tracking-normal pb-4 "> Start spending and <br></br> | ||
| saving with <span className="text-[#52AEEF] font-normal" style={{fontFamily: '"gooddog-new", sans-serif'}}> confidence. </span> | ||
| </p> | ||
| <PrimaryButton | ||
| buttonColor="#F5A243" | ||
| borderColor="#F5A243" | ||
| textColor="#ffffff" | ||
| buttonWidth="150px" | ||
| buttonHeight="40px" | ||
| fontSize="20px" | ||
| /> | ||
|
|
||
|
|
||
| </div> | ||
| </div> | ||
| <div className="flex justify-center px-4 mb-8"> | ||
| <div className="relative bg-white max-w-lg h-auto w-75 flex | ||
| flex-col items-center justify-center mx-auto tracking-wide | ||
| rounded-2xl border-2 border-[#52AEEF] shadow-[10px_10px_0px_#ABD8F6] | ||
| md:shadow-[15px_15px_0px_#ABD8F6] px-6 md:px-8 md:w-100 py-8 md:py-10 lg:w-1/2"> | ||
|
|
||
| {imageSrc && ( | ||
| <img | ||
| src={imageSrc} | ||
| className="absolute -bottom-7 -right-21 scale-x-[-1] h-32 z-50 md:w-100 md:h-auto md:-right-73 md:-bottom-8 lg:top-3" | ||
| /> | ||
| )} | ||
|
|
||
| <p className="text-center! font-semibold! text-2xl! md:text-4xl! tracking-normal! leading-snug! pb-6! m-0!"> | ||
| Start spending and <br /> | ||
| saving with{" "} | ||
| <span className="text-[#52AEEF] font-normal" style={{ fontFamily: '"gooddog-new", sans-serif' }}> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added props here |
||
| confidence. | ||
| </span> | ||
| </p> | ||
| <PrimaryButton | ||
| buttonColor="#F5A243" | ||
| borderColor="#F5A243" | ||
| textColor="#ffffff" | ||
| buttonWidth="150px" | ||
| buttonHeight="40px" | ||
| fontSize="20px" | ||
| /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| } | ||
| export default WaitListJoin | ||
| export default WaitListJoin; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,19 +2,29 @@ type PrimaryButtonProps = { | |
| buttonColor: string; | ||
| borderColor: string; | ||
| textColor: string; | ||
| buttonWidth?: string; | ||
| buttonHeight?: string; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added props |
||
| fontSize?: string | ||
|
|
||
|
|
||
| }; | ||
|
|
||
| const PrimaryButton = ({buttonColor, borderColor, textColor}: PrimaryButtonProps) => { | ||
| const PrimaryButton = ({buttonColor, borderColor, textColor, buttonWidth, buttonHeight, fontSize}: PrimaryButtonProps) => { | ||
| return ( | ||
| <a | ||
| href="/join-waitlist" | ||
| className="px-2 pr-4 rounded-xl whitespace-nowrap border font-semibold" | ||
| style={{backgroundColor: buttonColor, | ||
| borderColor: borderColor, | ||
| color: textColor}}> Join Waitlist | ||
| className=" whitespace-nowrap border flex items-center justify-center rounded-4xl tracking-normal" | ||
| style={{ | ||
| backgroundColor: buttonColor, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pretty straightforward, added props again |
||
| borderColor: borderColor, | ||
| color: textColor, | ||
| height: buttonHeight, | ||
| width: buttonWidth, | ||
| fontSize: fontSize | ||
| }}> Join Waitlist | ||
| </a> | ||
| ) | ||
| } | ||
|
|
||
|
|
||
| export default PrimaryButton | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,15 +13,14 @@ const Header = () => { | |
|
|
||
| return ( | ||
|
|
||
| <header className="relative flex justify-between items-center gap-2 w-full border bg-white px-7 py-6"> | ||
| {/* Logo */} | ||
| <div className="relative"> | ||
| <div className=" whitespace-nowrap mr-8 text-2xl"> | ||
| <span className="text-[#FA9E4D]"> Two </span><span className="text-[#52AEEF]"> Cents </span> | ||
| <header className="relative flex justify-between items-center gap-2 w-full bg-white px-7 py-6 z-40 md:z-60"> | ||
| <div> | ||
| <img | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed text + image -> svg logo |
||
| src="/media/Logo.svg" | ||
| className="h-16 md:h-18 w-auto object-contain" | ||
| /> | ||
| </div> | ||
| <img className="w-12 absolute top-1 right-19" src="/images/centy-bill.png"></img> | ||
| </div> | ||
|
|
||
|
|
||
| {/* Desktop NavBar */} | ||
| <nav className="items-center font-semibold hidden md:flex" > | ||
| <div className="flex gap-10"> | ||
|
|
@@ -34,7 +33,6 @@ const Header = () => { | |
| {label} | ||
| </a> | ||
| ))} | ||
|
|
||
| <a className="text-[#FA9E4D] bg-white border border-[#FA9E4D] px-2 rounded-xl pr-4 whitespace-nowrap hover:bg-[#FA9E4D] hover:text-white transition ease-in-out" href="/join-waitlist" >Join Waitlist</a> | ||
| </div> | ||
| </nav> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,20 @@ | ||
| @import "tailwindcss"; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i had a lot of issues with the index.css globally overriding my pages and my tailwind classes, i think you can restore this to the previous file as i added !important to the styling that overlaps with index.css |
||
|
|
||
|
|
||
| :root { | ||
| --text: #6b6375; | ||
| --text-h: #08060d; | ||
| --bg: #fff; | ||
| --border: #e5e4e7; | ||
| --code-bg: #f4f3ec; | ||
| --accent: #aa3bff; | ||
| --accent-bg: rgba(170, 59, 255, 0.1); | ||
| --accent-border: rgba(170, 59, 255, 0.5); | ||
| --social-bg: rgba(244, 243, 236, 0.5); | ||
| --shadow: | ||
| rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px; | ||
|
|
||
| --sans: system-ui, 'Segoe UI', Roboto, sans-serif; | ||
| --heading: system-ui, 'Segoe UI', Roboto, sans-serif; | ||
| --mono: ui-monospace, Consolas, monospace; | ||
|
|
||
| font: 18px/145% var(--sans); | ||
| letter-spacing: 0.18px; | ||
| color-scheme: light dark; | ||
| color: var(--text); | ||
| background: var(--bg); | ||
| font-synthesis: none; | ||
| text-rendering: optimizeLegibility; | ||
| -webkit-font-smoothing: antialiased; | ||
| -moz-osx-font-smoothing: grayscale; | ||
| #root { | ||
| width: 100%; | ||
| min-height: 100svh; | ||
| display: flex; | ||
| flex-direction: column; | ||
| box-sizing: border-box; | ||
|
|
||
| } | ||
|
|
||
| @media (max-width: 1024px) { | ||
| font-size: 16px; | ||
| } | ||
| html, body { | ||
| margin: 0; | ||
| padding: 0; | ||
| width: 100%; | ||
| overflow-x: hidden; | ||
| } | ||
|
|
||
| @media (prefers-color-scheme: dark) { | ||
|
|
@@ -53,38 +37,30 @@ | |
| } | ||
| } | ||
|
|
||
| #root { | ||
| width: 1126px; | ||
| max-width: 100%; | ||
| margin: 0 auto; | ||
| text-align: center; | ||
| border-inline: 1px solid var(--border); | ||
| min-height: 100svh; | ||
| display: flex; | ||
| flex-direction: column; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
|
|
||
| body { | ||
| margin: 0; | ||
| } | ||
|
|
||
|
|
||
|
|
||
| h1, | ||
| h2 { | ||
| font-family: var(--heading); | ||
| font-weight: 500; | ||
| color: var(--text-h); | ||
| /* font-weight: 500; | ||
| /* color: var(--text-h); */ | ||
| } | ||
|
|
||
| h1 { | ||
| font-size: 56px; | ||
| /* font-size: 56px; | ||
| letter-spacing: -1.68px; | ||
| margin: 32px 0; | ||
| @media (max-width: 1024px) { | ||
| font-size: 36px; | ||
| margin: 20px 0; | ||
| margin: 20px 0; */ | ||
| } | ||
| } | ||
|
|
||
| h2 { | ||
| font-size: 24px; | ||
| line-height: 118%; | ||
|
|
@@ -232,6 +208,11 @@ code { | |
| height: 1.15em; | ||
| } | ||
|
|
||
| /* rating styling */ | ||
| .react-simple-star-rating svg { | ||
| display: inline !important; | ||
| } | ||
|
|
||
| /* Responsive Design */ | ||
| @media (max-width: 768px) { | ||
| .footer-content { | ||
|
|
||
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.
keep my changes, here used this library for ratings