Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CoNETProject committed Nov 28, 2023
1 parent 26ffb56 commit 67b835d
Show file tree
Hide file tree
Showing 7 changed files with 360 additions and 91 deletions.
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
],
"homepage": "https://conet.network",
"main": "./src/electron/electron.js",
"resolutions": {
"@types/react": "^18.2.38"
},
"scripts": {
"start": "concurrently --kill-others --success=first 'yarn start:gateway' 'yarn _start:web' 'wait-on tcp:3000 && NODE_ENV=development yarn _start:desktop'",
"start:storybook": "start-storybook -p 6006 -s public",
Expand All @@ -32,7 +35,7 @@
"@mui/icons-material": "^5.14.18",
"@mui/material": "^5.14.18",
"@mui/lab": "^5.0.0-alpha.153",
"primereact": "^10.0.9",
"primereact": "^10.1.1",
"@react-icons/all-files": "^4.1.0",
"@tippyjs/react": "^4.2.6",
"dayjs": "^1.11.10",
Expand Down Expand Up @@ -63,12 +66,13 @@
"@testing-library/user-event": "^14.5.1",
"@types/jest": "^29.5.8",
"@types/node": "^20.9.2",
"@types/react": "^18.2.37",
"@types/react": "^18.2.38",
"@types/react-document-meta": "^3.0.5",
"@types/react-dom": "^18.2.15",
"@types/react-dom": "^18.2.17",
"@types/react-router-dom": "^5.3.3",
"@types/styled-components": "^5.1.30",
"@types/styled-components": "^5.1.32",
"@types/uuid": "^9.0.7",
"@types/react-swipeable-views": "^0.13.5",
"babel-loader": "^9.1.3",
"concurrently": "^8.2.2",
"buffer": "^6.0.3",
Expand All @@ -85,9 +89,10 @@
"react-redux": "^8.1.3",
"react-scripts": "^5.0.1",
"styled-components": "^6.1.1",
"typescript": "^5.2.2",
"typescript": "^5.3.2",
"wait-on": "^7.2.0",
"caniuse-lite": "^1.0.30001563"
"caniuse-lite": "^1.0.30001564",
"react-swipeable-views": "^0.14.0"
},
"browserslist": {
"production": [
Expand Down
28 changes: 3 additions & 25 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,17 @@ import React, {useEffect, useRef} from 'react'
import GlobalStyle from '../UI/Global/Styles'
import styled from 'styled-components'
import useAppState from '../../store/appState/useAppState'
import MainScreen from './MainScreen/MainScreen'
import { LayoutGroup, motion, useAnimation, useDragControls, useMotionValue, useTransform} from 'framer-motion'
import LaunchPage from './Apps/launchPage'
import JoinUS from './Apps/joinUS'
import Box from '@mui/material/Box'
import SpeedDial, { SpeedDialProps } from '@mui/material/SpeedDial'
import FileCopyIcon from '@mui/icons-material/FileCopyOutlined';
import SaveIcon from '@mui/icons-material/Save'
import PrintIcon from '@mui/icons-material/Print'
import ShareIcon from '@mui/icons-material/Share'
import SpeedDialIcon from '@mui/material/SpeedDialIcon'
import SpeedDialAction from '@mui/material/SpeedDialAction'
import {US, CN,JP, TW } from 'country-flag-icons/react/3x2'
import SvgIcon from '@mui/material/SvgIcon'
import {Locale} from "../../localization/types"
import Proxy from './Apps/CONET-Proxy/index'
import ConetAPP from './LaunchAPP'
import {testLocalServer} from '../../API/index'
import Miner from './Apps/miner'

import DashBoard from './Apps/dashboard'
import NoDeamon from './NoDaemon'
const StyledContainer = styled.div`
height: 100vh;
Expand All @@ -38,6 +29,7 @@ type action = {
icon: JSX.Element
name: Locale
}

const actions: action[] = [
{ icon: <SvgIcon component={JP} inheritViewBox/>, name: 'ja-JP' },
{ icon: <SvgIcon component={CN} inheritViewBox/>, name: 'zh-CN' },
Expand All @@ -47,22 +39,8 @@ const actions: action[] = [

const App = () => {
const {
isInitializing,
isPlatformLoading,
setNetworkStrength,
setWindowInnerSize,
setClientDevices,
setIsTouchDevice,
showJoinUS,
setShowAppStore,
setIsModalOpen,
setIsShowOverlay,
showOverlay,
hasContainer,
isUnlocked,
locale,
setLocale,
showGuide,
showAppStore,
localDaemon,
setlocalDaemon,
Expand Down Expand Up @@ -131,12 +109,12 @@ const App = () => {
const switchShow = () => {
return (
<>

{ !(showMiner || showAppStore) && <JoinUS/>}
{(showMiner || showAppStore) && <ShowApp />}
</>
)
}

return (
<>
<GlobalStyle/>
Expand Down
229 changes: 229 additions & 0 deletions src/components/App/Apps/dashboard/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
import { createTheme, ThemeProvider, makeStyles, styled, useTheme } from '@mui/material/styles'
import Container from '@mui/material/Container'
import Stack from '@mui/material/Stack'
import Tabs from '@mui/material/Tabs'
import Tab from '@mui/material/Tab'
import AppBar from '@mui/material/AppBar'
import Toolbar from '@mui/material/Toolbar'
import IconButton from '@mui/material/IconButton'
import MenuIcon from '@mui/icons-material/Menu'
import Typography from '@mui/material/Typography'
import Button from '@mui/material/Button'
import {ReactComponent as CONETIcon} from '../../../../assets/logo/CoNET_logo_white.svg'
import React, {HTMLAttributes, useState, useEffect, SyntheticEvent, ReactNode} from "react"
import SvgIcon from '@mui/material/SvgIcon'
import type {SxProps, Theme} from '@mui/material/'
import AccountCircleIcon from '@mui/icons-material/AccountCircle'
import LocalLaundryServiceIcon from '@mui/icons-material/LocalLaundryService'
import VpnLockIcon from '@mui/icons-material/VpnLock'
import SwipeableViews from 'react-swipeable-views'
import Box from '@mui/material/Box'
import Proxy from '../CONET-Proxy'
import Slide from '@mui/material/Slide'
import useAppState from "../../../../store/appState/useAppState"

interface TabPanelProps {
children?: React.ReactNode
dir?: string
index: number
value: number
}

interface StyledTabProps {
label?: string
icon?: string | React.ReactElement<any, string | React.JSXElementConstructor<any>>
sx?:SxProps<Theme>
}

const themeTopArea1 = createTheme ({
typography: {
h3: {
'fontWeight': '600'
},
h4: {
'fontWeight': '600'
},
h6: {
color: 'rgba(0,0,0,0.6)'
},
fontFamily: [
'Inter',
'"Inter Placeholder"',
'sans-serif',
].join(','),
},
})


const StackContainer = styled(Stack)(() => ({
height: '100vh'
}))
const a11yProps = (index: number) => {
return {
id: `vertical-tab-${index}`,
'aria-controls': `vertical-tabpanel-${index}`,
}
}
interface StyledTabsProps {
children?: React.ReactNode;
value: number;
onChange: (event: React.SyntheticEvent, newValue: number) => void;
}

const StyledTabsMobile = styled((props: StyledTabsProps) => (
<AppBar position="fixed" sx={{top: 'auto', bottom: 0}}>
<Tabs
{...props}
TabIndicatorProps={{ children: <span className="MuiTabs-indicatorSpan" /> }}
/>
</AppBar>

))({
'& .MuiTabs-indicator': {
display: 'flex',
justifyContent: 'center',
backgroundColor: 'transparent',
},
'& .MuiTabs-indicatorSpan': {
maxWidth: 40,
width: '100%',
backgroundColor: '#635ee7',
},
})


const StyledTabs = styled((props: StyledTabsProps) => (
<Tabs orientation="vertical"
{...props}
TabIndicatorProps={{ children: <span className="MuiTabs-indicatorSpan" /> }}
/>
))({
'& .MuiTabs-indicator': {
display: 'flex',
justifyContent: 'center',
backgroundColor: 'transparent',
},
'& .MuiTabs-indicatorSpan': {
maxWidth: 40,
width: '100%',
backgroundColor: '#635ee7',
},
})

const StyledTab = styled((props: StyledTabProps) => (
<Tab disableRipple {...props} />
))(({ theme }) => ({
textTransform: 'none',
fontWeight: theme.typography.fontWeightRegular,
fontSize: theme.typography.pxToRem(15),
marginRight: theme.spacing(1),
color: 'rgba(255, 255, 255, 0.7)',
'&.Mui-selected': {
color: '#B5E687',
},
'&.Mui-focusVisible': {
backgroundColor: 'rgba(100, 95, 228, 0.32)',
},
}))


const TabPanel = (props: TabPanelProps) => {
const { children, value, index, ...other } = props
return (
<div
role="tabpanel"
hidden={value !== index}
id={`full-width-tabpanel-${index}`}
aria-labelledby={`full-width-tab-${index}`}
{...other}
>
{value === index && (
<Box sx={{ p: 3 }}>
<Typography>{children}</Typography>
</Box>
)}
</div>
)
}


const DashBoard = () => {
const [value, setValue] = useState(0)
const {
windowInnerSize: {width},
setClientProfiles,
showAppStore,
setIsModalOpen,
showMiner
} = useAppState()

const theme = useTheme()
const handleChange = (event: SyntheticEvent, newValue: number) => {
setValue(newValue)
}

const handleChangeIndex = (index: number) => {
setValue(index)
}

const Menu = () => {


return (
<StyledTabs
value={value}
onChange={handleChange}
aria-label="Vertical tabs example"
sx={{ backgroundColor: 'black',
minWidth: '6rem',
display:{xs: 'none', sm: 'flex', md: 'flex', xm: 'flex', lg: 'flex', xl: 'flex'},
paddingTop: '3rem'
}}
>
<Tab {...a11yProps(0)} icon={<SvgIcon component={CONETIcon} inheritViewBox sx={{ fontSize: 40 }}/>} sx={{paddingBottom: '4rem'}}/>


<StyledTab {...a11yProps(1)} icon={<SvgIcon component={LocalLaundryServiceIcon} inheritViewBox sx={{ fontSize: 40 }}/>} sx={{paddingBottom: '2rem'}} />
<StyledTab {...a11yProps(2)} icon={<SvgIcon component={VpnLockIcon} inheritViewBox sx={{ fontSize: 40 }}/>} sx={{paddingBottom: '2rem'}}/>
<StyledTab {...a11yProps(3)} icon={<SvgIcon component={AccountCircleIcon} inheritViewBox sx={{ fontSize: 40 }}/>} sx ={{ position: 'fixed', bottom: '0px'}} />
</StyledTabs>
)
}

const MenuMobile = () => {

return (
<StyledTabsMobile
value={value}
onChange={handleChange}
aria-label="Vertical tabs example"
sx={{ backgroundColor: 'black',
display:{xs: 'flex', sm: 'none', md: 'none', xm: 'none', lg: 'none', xl: 'none'}
}}
>
<Tab {...a11yProps(0)} icon={<SvgIcon component={CONETIcon} inheritViewBox sx={{ fontSize: 40 }}/>} />


<StyledTab {...a11yProps(1)} icon={<SvgIcon component={LocalLaundryServiceIcon} inheritViewBox sx={{ fontSize: 40 }}/>} sx={{}}/>
<StyledTab {...a11yProps(2)} icon={<SvgIcon component={VpnLockIcon} inheritViewBox sx={{ fontSize: 40 }}/>} sx={{}}/>
<StyledTab {...a11yProps(3)} icon={<SvgIcon component={AccountCircleIcon} inheritViewBox sx={{ fontSize: 40, position: 'fixed', right: '1rem' }}/>} />
</StyledTabsMobile>
)
}

return (
<ThemeProvider theme={themeTopArea1} >
<Box>
<StackContainer direction="row" id='sscscsf'>
<MenuMobile/>
<Menu />
<Proxy />
</StackContainer>
</Box>


</ThemeProvider>
)
}

export default DashBoard
Binary file added src/components/App/Apps/miner/assets/Untitled.pdf
Binary file not shown.
Loading

0 comments on commit 67b835d

Please sign in to comment.