From e9af22c3a7c3861339b9a24676798e2ac44b6ffc Mon Sep 17 00:00:00 2001 From: NancyAanchal Date: Sun, 21 Jul 2024 01:00:08 +0545 Subject: [PATCH] added streak display component acc to figma --- .../src/components/DictionarySearchBar.tsx | 4 +-- nepalingo-web/src/components/GreetingCard.tsx | 25 +++++----------- .../src/components/header/Header.tsx | 2 +- .../src/components/header/StreakDisplay.tsx | 30 +++++++++++++++++++ .../src/components/header/StreakPhrase.tsx | 1 - nepalingo-web/src/pages/Home.tsx | 14 ++++----- 6 files changed, 48 insertions(+), 28 deletions(-) create mode 100644 nepalingo-web/src/components/header/StreakDisplay.tsx diff --git a/nepalingo-web/src/components/DictionarySearchBar.tsx b/nepalingo-web/src/components/DictionarySearchBar.tsx index 5580fca..5a58cbf 100644 --- a/nepalingo-web/src/components/DictionarySearchBar.tsx +++ b/nepalingo-web/src/components/DictionarySearchBar.tsx @@ -1,10 +1,10 @@ import React, { useState } from "react"; import useDictionary, { DictionaryProps } from "../hooks/useDictionary"; import InputText from "../components/InputText"; -import Button from "../components/Button"; // Assuming you have a Button component +import Button from "../components/Button"; interface DictionarySearchBarProps { - language: DictionaryProps["language"]; // Define language as a prop + language: DictionaryProps["language"]; } const DictionarySearchBar: React.FC = ({ diff --git a/nepalingo-web/src/components/GreetingCard.tsx b/nepalingo-web/src/components/GreetingCard.tsx index 0688d6f..d10a958 100644 --- a/nepalingo-web/src/components/GreetingCard.tsx +++ b/nepalingo-web/src/components/GreetingCard.tsx @@ -5,21 +5,6 @@ interface GreetingCardProps { name: string; } -const cardStyle: React.CSSProperties = { - border: "2px solid #000", - borderRadius: "15px", - padding: "20px", - margin: "10px", - textAlign: "center", - backgroundColor: "#f0f0f0", - fontFamily: "Arial, sans-serif", -}; - -const headingStyle: React.CSSProperties = { - fontSize: "2em", - color: "#333", -}; - const GreetingCard: React.FC = ({ name }) => { ReactGA.send({ hitType: "pageview", @@ -37,9 +22,15 @@ const GreetingCard: React.FC = ({ name }) => { return "Good Evening"; } }; + return ( -
-

{`${getCurrentGreeting()}, ${name}`}

+
+

+ {`${getCurrentGreeting()} ${name},`} +

+

+ Lets learn some new words today! +

); }; diff --git a/nepalingo-web/src/components/header/Header.tsx b/nepalingo-web/src/components/header/Header.tsx index bee0c95..892820d 100644 --- a/nepalingo-web/src/components/header/Header.tsx +++ b/nepalingo-web/src/components/header/Header.tsx @@ -5,7 +5,7 @@ import ChangeLanguage from "@/components/header/ChangeLanguage"; const Header: React.FC = () => { return ( -