-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from polywrap/style-updates-2
Styles for Strategy page
- Loading branch information
Showing
12 changed files
with
197 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
interface PluralizeProps { | ||
strings: string[]; | ||
count: number; | ||
} | ||
|
||
// If count is greater than 1, | ||
// the second string will be used, | ||
// otherwise the first will be used | ||
export const pluralize = (strings: string[], count: number) => | ||
strings[count && count > 1 ? 1 : 0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use client"; | ||
|
||
import { usePathname } from "next/navigation"; | ||
import clsx from "clsx"; | ||
|
||
export default function Main({ children }: { children: React.ReactNode }) { | ||
const pathname = usePathname(); | ||
|
||
return ( | ||
<main | ||
className={clsx( | ||
"flex h-screen min-h-screen flex-col items-center", | ||
pathname === "/" | ||
? "bg-gradient-to-br from-indigo-200 to-indigo-300" | ||
: "bg-gradient-to-b from-indigo-300 via-indigo-50 to-white" | ||
)}> | ||
<div className='flex flex-col w-full flex-grow overflow-y-auto'> | ||
{children} | ||
</div> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
import HighScoreIcon from "@/public/high-score-icon.svg"; | ||
import CopyToClipboardIcon from "@/public/copy-to-clipboard.svg" | ||
import Image from "next/image"; | ||
import { Info } from "@phosphor-icons/react/dist/ssr"; | ||
import { ScoreIcon } from "./Icons"; | ||
|
||
export default function Score({ rank }: { rank: number }) { | ||
// TODO: Attach medium and low icons | ||
const Icon = rank > 0.6 ? HighScoreIcon : null; | ||
if (Icon) { | ||
return ( | ||
<div className="flex flex-wrap gap-2 items-center justify-center"> | ||
<div> | ||
<Image alt="score" priority src={Icon} /> | ||
</div> | ||
return ( | ||
<div className='flex flex-wrap gap-2 items-center justify-between'> | ||
<div className='flex space-x-2 items-center'> | ||
<ScoreIcon rank={rank} /> | ||
<div>{(rank * 10).toFixed(1)}</div> | ||
<div> | ||
<Image className="hover:cursor-pointer" alt="copy-clipboard" src={CopyToClipboardIcon} /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
return null; | ||
<div> | ||
<Info size={20} className='text-indigo-300 hover:text-indigo-500' /> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.