Skip to content

Commit

Permalink
feat(client): add content to home and refine leaderboard data & design (
Browse files Browse the repository at this point in the history
#583)

* add font

* add useful content into home page

* refine leaderboard design and data

* revert the max-w

* further refine leaderboard design
  • Loading branch information
umitcan07 authored Oct 21, 2024
1 parent 0844c8a commit a81d383
Show file tree
Hide file tree
Showing 10 changed files with 524 additions and 73 deletions.
1 change: 0 additions & 1 deletion client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/>
<meta name="robots" content="index, follow" />
<meta name="theme-color" content="#06b6d4" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="Turquiz" />
<meta name="application-name" content="Turquiz" />
Expand Down
Binary file added client/public/innovator.woff2
Binary file not shown.
11 changes: 7 additions & 4 deletions client/src/components/quiz-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { getRelativeTime } from "../utils";
type QuizCardProps = {
quiz: Quiz;
onTagClick: (tag: string) => void;
key: string;
};

const difficultyText = cva([
Expand Down Expand Up @@ -59,9 +60,10 @@ const scoreClass = cva(
const scoreToInteger = (score: number) =>
Math.floor(score) as 0 | 1 | 2 | 3 | 4;

export const QuizCard = ({ quiz, onTagClick }: QuizCardProps) => {
export const QuizCard = ({ quiz, onTagClick, key }: QuizCardProps) => {
return (
<div
key={key}
aria-label={quiz.title}
className="relative flex max-w-xl flex-col gap-4 rounded-2 bg-white px-6 py-6 shadow-none ring ring-slate-200 transition-all duration-200"
>
Expand All @@ -84,14 +86,15 @@ export const QuizCard = ({ quiz, onTagClick }: QuizCardProps) => {
<TooltipProvider>
<TooltipAnchor
render={
<a
href="#"
<span
tabIndex={0}
aria-label={`Rated by ${quiz.rating.count}`}
className={scoreClass({
score: scoreToInteger(quiz.rating.score),
})}
>
{quiz.rating.score.toFixed(1)}
</a>
</span>
}
></TooltipAnchor>
<Tooltip>
Expand Down
4 changes: 2 additions & 2 deletions client/src/mocks/mocks.quiz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const quizOverviews: QuizOverview[] = [
},
tags: [
{
id: "471",
id: "4571",
name: "human",
},
{
Expand Down Expand Up @@ -99,7 +99,7 @@ export const quizOverviews: QuizOverview[] = [
name: "seasons",
},
{
id: "9879",
id: "98791",
name: "fun",
},
{
Expand Down
Loading

0 comments on commit a81d383

Please sign in to comment.