Skip to content

Commit

Permalink
Merge pull request #325 from bounswe/mobile/feature/new-mock-data
Browse files Browse the repository at this point in the history
feat: Create new mock data and use it
  • Loading branch information
karatashsyn authored Oct 21, 2024
2 parents a7185a2 + de87db3 commit b74f929
Show file tree
Hide file tree
Showing 40 changed files with 1,817 additions and 2,077 deletions.
3 changes: 2 additions & 1 deletion mobile/tradeverse/components/links/asset-link.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import { router } from "expo-router";
export default function AssetLink({
children,
target = paths.EXPLORE.ASSET_DETAIL,
asset,
}) {
return (
<Pressable
onPress={() => {
router.push(target);
router.push(`${target}?assetId=${asset?.id}`);
}}
>
{children}
Expand Down
3 changes: 2 additions & 1 deletion mobile/tradeverse/components/links/post-link.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import { router } from "expo-router";
export default function PostLink({
children,
target = paths.EXPLORE.POST_DETAIL,
post
}) {
return (
<Pressable
onPress={() => {
router.push(target);
router.push(`${target}?postId=${post?.id}`);
}}
>
{children}
Expand Down
3 changes: 2 additions & 1 deletion mobile/tradeverse/components/links/subforum-link.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import { router } from "expo-router";
export default function SubforumLink({
children,
target = paths.EXPLORE.SUBFORUM_DETAIL,
subForum,
}) {
return (
<Pressable
onPress={() => {
router.push(target);
router.push(`${target}?subforumId=${subForum?.id}`);
}}
>
{children}
Expand Down
3 changes: 2 additions & 1 deletion mobile/tradeverse/components/links/user-link.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import paths from "../../config/screen-paths";
export default function UserLink({
children,
target = paths.EXPLORE.USER_PROFILE,
user
}) {
return (
<Pressable
onPress={() => {
router.push(target);
router.push(`${target}?username=${user?.username}`);
}}
>
{children}
Expand Down
40 changes: 40 additions & 0 deletions mobile/tradeverse/mock-data/HomeData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { allSubforums } from "./all-subforums";

const allPosts = allSubforums.reduce((acc, subforum) => {
return acc.concat(subforum.posts);
}, []);

export const HomeData = {
ForYouPosts: [
{
title: "How to pass bruh to moment here.",
content: [
{
type: "text",
value: "Rising inflation impacts everyone’s wallet...",
},
{ type: "tag", value: "investments" },
{ type: "text", value: "and tracking key economic indicators." },
{ type: "tag", value: "Inflation" },
{ type: "tag", value: "FinanceTips" },
],
date: "2021-01-01",
likes: 10,
dislikes: 2,
comments: 5,
views: 1200,
subforum: {
name: "Future Investment",
id: 1,
},
author: {
name: "Daron",
surname: "Acemoglu",
username: "daronacemoglu",
avatar:
"https://img.kitapyurdu.com/v1/getImage/fn:10642557/wi:200/wh:526d5c04e",
id: 1,
},
},
],
};
26 changes: 26 additions & 0 deletions mobile/tradeverse/mock-data/Portfolio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export const Portfolio = [
{
symbol: "BTC",
name: "Bitcoin",
value: "0.005",
logo: "https://s2.coinmarketcap.com/static/img/coins/64x64/1.png",
},
{
symbol: "USD",
name: "US Dollar",
value: "$31.82",
logo: "https://s2.coinmarketcap.com/static/img/coins/64x64/2781.png",
},
{
symbol: "EUR",
name: "Euro",
value: "€52.96",
logo: "https://s2.coinmarketcap.com/static/img/coins/64x64/2790.png",
},
{
symbol: "JPY",
name: "Japanese Yen",
value: "¥4000.50",
logo: "https://s2.coinmarketcap.com/static/img/coins/64x64/2793.png",
},
];
243 changes: 243 additions & 0 deletions mobile/tradeverse/mock-data/all-assets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
//
export const allAssets = [
{
abbreviation: "BTC",
label: "Bitcoin",
image: "https://example.com/btc.png",
},
{
abbreviation: "ETH",
label: "Ethereum",
image: "https://example.com/eth.png",
},
{
abbreviation: "LTC",
label: "Litecoin",
image: "https://example.com/ltc.png",
},
{
abbreviation: "AAPL",
label: "Apple Inc.",
image: "https://example.com/aapl.png",
},
{
abbreviation: "GOOGL",
label: "Alphabet Inc.",
image: "https://example.com/googl.png",
},
{
abbreviation: "AMZN",
label: "Amazon.com Inc.",
image: "https://example.com/amzn.png",
},
{
abbreviation: "TSLA",
label: "Tesla Inc.",
image: "https://example.com/tsla.png",
},
{
abbreviation: "XAU",
label: "Gold",
image: "https://example.com/xau.png",
},
{
abbreviation: "XAG",
label: "Silver",
image: "https://example.com/xag.png",
},
{
abbreviation: "EURUSD",
label: "Euro/US Dollar",
image: "https://example.com/eurusd.png",
},
{
abbreviation: "GBPUSD",
label: "British Pound/US Dollar",
image: "https://example.com/gbpusd.png",
},
{
abbreviation: "USDJPY",
label: "US Dollar/Japanese Yen",
image: "https://example.com/usdjpy.png",
},
{
abbreviation: "USDCAD",
label: "US Dollar/Canadian Dollar",
image: "https://example.com/usdcad.png",
},
{
abbreviation: "WTI",
label: "West Texas Intermediate (Crude Oil)",
image: "https://example.com/wti.png",
},
{
abbreviation: "BRN",
label: "Brent Crude Oil",
image: "https://example.com/brn.png",
},
{
abbreviation: "SP500",
label: "S&P 500 Index",
image: "https://example.com/sp500.png",
},
{
abbreviation: "DJIA",
label: "Dow Jones Industrial Average",
image: "https://example.com/djia.png",
},
{
abbreviation: "NDAQ",
label: "NASDAQ 100 Index",
image: "https://example.com/ndaq.png",
},
{
abbreviation: "BABA",
label: "Alibaba Group",
image: "https://example.com/baba.png",
},
{
abbreviation: "NFLX",
label: "Netflix Inc.",
image: "https://example.com/nflx.png",
},
{
abbreviation: "MSFT",
label: "Microsoft Corporation",
image: "https://example.com/msft.png",
},
{
abbreviation: "V",
label: "Visa Inc.",
image: "https://example.com/visa.png",
},
{
abbreviation: "JPM",
label: "JPMorgan Chase & Co.",
image: "https://example.com/jpm.png",
},
{
abbreviation: "FB",
label: "Meta Platforms (Facebook)",
image: "https://example.com/fb.png",
},
{
abbreviation: "BA",
label: "The Boeing Company",
image: "https://example.com/ba.png",
},
{
abbreviation: "NVDA",
label: "NVIDIA Corporation",
image: "https://example.com/nvda.png",
},
{
abbreviation: "EUR",
label: "Euro",
image: "https://example.com/eur.png",
},
{
abbreviation: "USD",
label: "US Dollar",
image: "https://example.com/usd.png",
},
{
abbreviation: "GBP",
label: "British Pound",
image: "https://example.com/gbp.png",
},
{
abbreviation: "JPY",
label: "Japanese Yen",
image: "https://example.com/jpy.png",
},
{
abbreviation: "CAD",
label: "Canadian Dollar",
image: "https://example.com/cad.png",
},
{
abbreviation: "AUD",
label: "Australian Dollar",
image: "https://example.com/aud.png",
},
{
abbreviation: "CHF",
label: "Swiss Franc",
image: "https://example.com/chf.png",
},
{
abbreviation: "CNY",
label: "Chinese Yuan",
image: "https://example.com/cny.png",
},
{
abbreviation: "MXN",
label: "Mexican Peso",
image: "https://example.com/mxn.png",
},
{
abbreviation: "SGD",
label: "Singapore Dollar",
image: "https://example.com/sgd.png",
},
{
abbreviation: "KRW",
label: "South Korean Won",
image: "https://example.com/krw.png",
},
{
abbreviation: "RUB",
label: "Russian Ruble",
image: "https://example.com/rub.png",
},
{
abbreviation: "ZAR",
label: "South African Rand",
image: "https://example.com/zar.png",
},
{
abbreviation: "TRY",
label: "Turkish Lira",
image: "https://example.com/try.png",
},
{
abbreviation: "HKD",
label: "Hong Kong Dollar",
image: "https://example.com/hkd.png",
},
{
abbreviation: "INR",
label: "Indian Rupee",
image: "https://example.com/inr.png",
},
{
abbreviation: "BRL",
label: "Brazilian Real",
image: "https://example.com/brl.png",
},
{
abbreviation: "ARS",
label: "Argentine Peso",
image: "https://example.com/ars.png",
},
{
abbreviation: "CLP",
label: "Chilean Peso",
image: "https://example.com/clp.png",
},
{
abbreviation: "NZD",
label: "New Zealand Dollar",
image: "https://example.com/nzd.png",
},
{
abbreviation: "COP",
label: "Colombian Peso",
image: "https://example.com/cop.png",
},
].map((asset, index) => {
return {
...asset,
id: index + 1,
};
});
Loading

0 comments on commit b74f929

Please sign in to comment.