Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
fdf2d8e
feat: hide token
Anton-rock Nov 25, 2024
cb3fdae
Merge branch 'main' into feat/trading-view-advance
Laloww Dec 5, 2024
835f139
feat: add trading view
Laloww Dec 5, 2024
d5746ad
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
8835bd4
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
6e4c1ca
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
4fb9036
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
c6127aa
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
7a1030c
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
af1e634
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
140a542
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
37b3517
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
f7f9332
Update preInstall.mjs
Anton-rock Dec 5, 2024
a90e8b5
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
02047bf
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
9b04192
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
de4560c
Update preInstall.mjs
Anton-rock Dec 5, 2024
40b3c3f
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
d13ffa1
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
349b061
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
bd4f4eb
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
8f49fe5
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
d75ba2e
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
19bee41
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
acf86b4
feat: fix deploy
Laloww Dec 5, 2024
2eb1507
feat: fix deploy
Laloww Dec 5, 2024
2df5e37
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
3895e6b
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
a4a2747
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
893c8d4
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
32d070e
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
07de913
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
18fcd15
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
6c54942
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
f6c3de2
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
26b0c5e
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
5a4d853
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
19f7664
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
cfbb33e
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
afca317
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
fa369bc
fix .npmrc _authToken
STASiAN Dec 5, 2024
1b0918f
feat: fix build
Laloww Dec 5, 2024
db6eb55
Update README.md
Anton-rock Dec 5, 2024
7196eac
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
e338d2e
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
6d9575e
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
457e03c
Update deploy-to-cf-pages.yaml
Anton-rock Dec 5, 2024
d0d827d
Update deploy-to-cf-pages.yaml
Anton-rock Dec 6, 2024
fdc0ccc
Update deploy-to-cf-pages.yaml
Anton-rock Dec 6, 2024
9961374
feat: add select chart
Laloww Dec 9, 2024
334e7e9
Merge remote-tracking branch 'origin/feat/trading-view-advance' into …
Laloww Dec 9, 2024
e57c14c
feat: remove files
Laloww Dec 9, 2024
b9e6229
feat: add copy files
Laloww Dec 9, 2024
cc4ddfd
feat: fix bugs
Laloww Dec 9, 2024
d88a2a4
feat: update palete
Laloww Dec 9, 2024
a526c79
feat: change styled button
Laloww Dec 9, 2024
edcc8c8
feat: remove files
Laloww Dec 9, 2024
1c58ddd
feat: remove css
Laloww Dec 9, 2024
12fa9b1
feat: fix styled
Laloww Dec 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/deploy-to-cf-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ jobs:
contents: read
deployments: write
pull-requests: write
packages: read
runs-on: ubuntu-latest
timeout-minutes: 5
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
steps:
- name: "Checkout Github Action"
uses: actions/checkout@v4
Expand All @@ -32,14 +35,19 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
- name: Install Dependencies
run: |
pnpm install
- name: create env file
run: |
touch .env
echo VITE_FEATURE_TOGGLE_CLIENT_KEY=${{ vars.VITE_FEATURE_TOGGLE_CLIENT_KEY }} >> .env
- name: Configure npm authentication for GitHub Registry
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
echo "@compolabs:registry=https://npm.pkg.github.com/" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
- name: Install Dependencies
run: |
pnpm install
- name: Build Project
run: |
npm run build
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/vault-docker-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Configure npm authentication for GitHub Registry
run: |
echo "@compolabs:registry=https://npm.pkg.github.com/" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc

- name: Login to Docker Registry
uses: docker/login-action@v3
with:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ yarn-error.log*
.idea
.env

public/charting_library/
public/datafeeds/
public/charting_library/
src/charting_library/

package-lock.json
.npmrc
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ This project is licensed under the Business Source License 1.1. Please see the L

For more information on Spark and how to get involved, please visit our [official website](https://docs.sprk.fi/).


1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<!-- HTML Meta Tags -->
<title>Spark</title>
<meta charset="utf-8" />
<script src="/datafeeds/udf/dist/bundle.js"></script>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" name="viewport" />
<meta content="A Decentralized Order Book on Fuel.Network" name="description" />

Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"private": true,
"homepage": "https://app.sprk.fi",
"scripts": {
"start": "vite --open",
"build": "tsc && vite build",
"copy-tradingview-files": "copyfiles -u 3 node_modules/@compolabs/tradingview-chart/public/**/**/** ./",
"start": "pnpm run copy-tradingview-files && vite --open",
"build": "pnpm run copy-tradingview-files && tsc && vite build",
"lint": "eslint --ext .tsx,.ts . --fix",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
Expand All @@ -16,7 +17,8 @@
"pnpm": ">=9.7.0"
},
"dependencies": {
"@compolabs/spark-orderbook-ts-sdk": "^1.14.2",
"@compolabs/spark-orderbook-ts-sdk": "https://registry.npmjs.org/@compolabs/spark-orderbook-ts-sdk/-/spark-orderbook-ts-sdk-1.14.2.tgz",
"@compolabs/tradingview-chart": "^1.0.21",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@fuels/connectors": "^0.36.1",
Expand Down Expand Up @@ -72,6 +74,7 @@
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react": "^4.2.1",
"copyfiles": "^2.4.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-react-app": "^7.0.1",
Expand All @@ -92,6 +95,7 @@
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.3.2"
},
"type": "module",
"browserslist": {
"production": [
">0.2%",
Expand Down
6,693 changes: 3,262 additions & 3,431 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

17 changes: 0 additions & 17 deletions public/tw-chart-styles.css

This file was deleted.

11 changes: 2 additions & 9 deletions src/components/AccordionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { AccordionItemProps } from "@szhsin/react-accordion/types/components/Acc

import { media } from "@themes/breakpoints";

import ArrowIcon from "@assets/icons/arrowUp.svg?react";

type Props = {
hideBottomBorder?: boolean;
} & AccordionItemProps;

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const AccordionItem: React.FC<Props> = ({ header, ...rest }) => (
<AccordionItemRoot
{...rest}
Expand All @@ -19,19 +18,13 @@ const AccordionItem: React.FC<Props> = ({ header, ...rest }) => (
}}
className="item"
contentProps={{ className: "itemContent" }}
header={
<>
{header}
<ArrowIcon className="arrow" />
</>
}
panelProps={{ className: "itemPanel" }}
/>
);

export default AccordionItem;

const AccordionItemRoot = styled(RawAccordionItem)<{ hideBottomBorder?: boolean }>`
const AccordionItemRoot = styled(RawAccordionItem)<{ hideBottomBorder?: boolean; header?: React.JSX.Element }>`
${({ hideBottomBorder, theme }) =>
hideBottomBorder ? "" : `border-bottom: 1px solid ${theme.colors.borderSecondary}`};
padding: 12px 0;
Expand Down
11 changes: 2 additions & 9 deletions src/components/Header/MenuNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,7 @@ export const MenuNav: React.FC<Props> = observer(({ isMobile, onMenuClick }) =>
</Element>
<AnimatePresence mode="wait">
{isDropdownOpen && (
<Dropdown
key="dropdown"
ref={dropdownRef}
animate="open"
exit="closed"
initial="closed"
variants={DROPDOWN_VARIANTS}
onClick={handleDropdownToggle}
>
<Dropdown key="dropdown" animate="open" exit="closed" initial="closed" variants={DROPDOWN_VARIANTS}>
{children.map((item) => renderChildMenuItem(item, isGradient))}
</Dropdown>
)}
Expand Down Expand Up @@ -343,6 +335,7 @@ const DropdownContainer = styled.div`
position: relative;
`;

// @ts-ignore
const Dropdown = styled(motion(SmartFlex))`
position: absolute;
top: 120%;
Expand Down
9 changes: 9 additions & 0 deletions src/global-types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// tradingview.d.ts
declare global {
interface Window {
TradingView: any;
Datafeeds: any;
}
}

export {};
2 changes: 1 addition & 1 deletion src/screens/Dashboard/AssetsDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const AssetsDashboard = observer(() => {
return (
<>
<TitleText type={TEXT_TYPES.H} primary>
Assets
Assets in my wallet
</TitleText>
<StyledTables>
{media.desktop ? (
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Dashboard/DashboardFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const DashboardFilter = observer(() => {
<DashboardTitleContainer>
<DashboardFilterContainer>
<TitleText type={TEXT_TYPES.H} primary>
Balance
Your Assets in Spark
</TitleText>
<SmartFlex gap="5px">
{filters.map((filter, index) => (
Expand Down
77 changes: 72 additions & 5 deletions src/screens/SpotScreen/Chart/Chart.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,67 @@
import React from "react";
import React, { useState } from "react";
import styled from "@emotion/styled";
import { observer } from "mobx-react";

import { Row } from "@components/Flex.tsx";
import { SmartFlex } from "@components/SmartFlex.tsx";
import Tab from "@components/Tab.tsx";
import { TEXT_TYPES } from "@components/Text.tsx";
import { media } from "@themes/breakpoints";

import TradingViewWidget from "./TradingViewWidget";
import { useStores } from "@stores";

const Chart: React.FC = () => {
import TradingViewChartAdvance from "@screens/SpotScreen/Chart/TradingViewAdvanceWidget.tsx";
import TradingViewWidget from "@screens/SpotScreen/Chart/TradingViewWidget.tsx";

const TABS = [
{ title: "SIMPLE CHART", disabled: false },
{ title: "ADVANCED CHART", disabled: false },
];

const Chart: React.FC = observer(() => {
const [activeChart, setActiveChart] = useState(1);
const handleSelect = (active: number) => {
setActiveChart(active);
};

const { tradeStore } = useStores();
const market = tradeStore.market?.symbol.replace("-", "");
return (
<Root>
<TradingViewWidget />
<HeaderTradingView>
<TabContainer>
{TABS.map(({ title, disabled }, index) => (
<Tab
key={title + index}
active={activeChart === index}
disabled={disabled}
type={TEXT_TYPES.BUTTON_SECONDARY}
onClick={() => !disabled && handleSelect(index)}
>
{title}
</Tab>
))}
</TabContainer>
</HeaderTradingView>
{activeChart === 1 ? (
market === "USDCUSDT" ? (
<CenterContainer>Not data</CenterContainer>
) : (
<TradingViewChartAdvance />
)
) : (
<TradingViewWidget />
)}
</Root>
);
};
});

export default Chart;

const Root = styled.div`
background: #141414;
border-radius: 8px;
border: 1px solid ${({ theme }) => theme.colors.borderSecondary};
display: flex;
flex-direction: column;
align-items: center;
Expand All @@ -33,3 +79,24 @@ const Root = styled.div`
height: 100%;
}
`;

const CenterContainer = styled(SmartFlex)`
justify-content: center;
align-items: center;
`;

const HeaderTradingView = styled(SmartFlex)`
height: auto;
gap: 5px;
padding: 8px 8px 0px 8px;
`;

const TabContainer = styled(Row)`
align-items: center;
padding-left: 4px;
position: relative;

${Tab} {
margin: 0 16px;
}
`;
Loading
Loading