Skip to content

Commit b7ac780

Browse files
Sterioboyjeongkite
andauthored
Feat/referral screen (#9)
* feat: referral screen with mocks * feat: api connected * fix: api function renamed * feat: added referrals tracker using start_params * fix: props fixed * fix: Menu screen padding-bottom added * feat: added WebView exapand feature * update: referral API DTO * wip: referrals layout * feat: points API added * fix: route naming fixed * feat: cleaned-up the mocks, connecetd transactions API, added util date function * fix: totalreferrals check * fix: removed '-' value from points display * fix: pointsData check * fix: aliases added to the router.tsx * fix: width resolution updated * feat: adjusted the referral DTO as TG TMA API * Updated /api/referral/track DTO Interface --------- Co-authored-by: Jeongyeon Yang <[email protected]>
1 parent 2424cca commit b7ac780

28 files changed

+997
-112
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8+
"ngrok": "ngrok http --domain=badger-cuddly-personally.ngrok-free.app 5173",
89
"build": "tsc && vite build",
910
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
1011
"preview": "vite preview"
@@ -17,7 +18,6 @@
1718
"@hookform/resolvers": "^3.3.4",
1819
"@mui/material": "^5.14.1",
1920
"@orbs-network/ton-access": "^2.3.3",
20-
"@supabase/supabase-js": "^2.39.8",
2121
"@ton/core": "^0.56.1",
2222
"@ton/crypto": "^3.2.0",
2323
"@ton/ton": "^13.11.1",
@@ -27,6 +27,7 @@
2727
"axios": "^1.5.0",
2828
"eslint-plugin-simple-import-sort": "^12.0.0",
2929
"framer-motion": "^10.16.4",
30+
"ngrok": "^5.0.0-beta.2",
3031
"react": "^18.2.0",
3132
"react-dom": "^18.2.0",
3233
"react-hook-form": "^7.51.4",
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 14 additions & 0 deletions
Loading

src/assets/icons/ic_copy.svg

Lines changed: 3 additions & 0 deletions
Loading

src/assets/image/ReferralCoins.png

36.3 KB
Loading

src/assets/image/ReferralGroup.png

169 KB
Loading
60.6 KB
Loading

src/components/common/Header.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useState } from "react";
22
import { useLocation, useNavigate } from "react-router-dom";
33
import { styled } from "styled-components";
44

5+
import IcReferral from "@/assets/icons/Landing/ic_landing_referral.svg";
56
import IcWalletConnect from "@/assets/icons/Landing/ic_landing_wallet.svg";
67
import IcWalletDisconnect from "@/assets/icons/Landing/ic_landing_wallet_disconnect.svg";
78
import useTonConnect from "@/hooks/contract/useTonConnect";
@@ -39,6 +40,9 @@ const Header = (props: HeaderProps) => {
3940
<HeaderWrapper $isOpen={isOpen} $backgroundType={backgroundType}>
4041
<HeaderTitle onClick={() => navigate("/")}>{text}</HeaderTitle>
4142
<HeaderRightBox>
43+
<ReferralButton onClick={() => navigate("/referral")}>
44+
<img src={IcReferral} alt="referral" />
45+
</ReferralButton>
4246
{pathname === "/" && (
4347
<DisconnectButton $connect={connected}>
4448
{connected ? (
@@ -81,6 +85,22 @@ const HeaderRightBox = styled.div`
8185
gap: 1rem;
8286
`;
8387

88+
const ReferralButton = styled.button`
89+
display: flex;
90+
justify-content: center;
91+
align-items: center;
92+
93+
width: 4.4rem;
94+
height: 4.4rem;
95+
padding: 1.2rem;
96+
97+
border: none;
98+
border-radius: 1.8rem;
99+
background: linear-gradient(96deg, #c078f9 5.73%, #6047f4 100%);
100+
101+
cursor: pointer;
102+
`;
103+
84104
const DisconnectButton = styled.button<{ $connect: boolean }>`
85105
display: flex;
86106
justify-content: center;
@@ -139,6 +159,7 @@ const MenuButton = styled.button<{ $isOpen: boolean }>`
139159
140160
cursor: pointer;
141161
`;
162+
142163
const HeaderTitle = styled.div`
143164
display: flex;
144165
align-items: center;

src/components/common/Loader.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { TailSpin } from "react-loader-spinner";
2+
3+
const Loader = () => {
4+
return (
5+
<TailSpin
6+
visible={true}
7+
height="30"
8+
width="30"
9+
color="#007aff"
10+
ariaLabel="tail-spin-loading"
11+
radius="4"
12+
wrapperStyle={{}}
13+
wrapperClass=""
14+
/>
15+
);
16+
};
17+
18+
export default Loader;

0 commit comments

Comments
 (0)