-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated layout and added extra information for users
- Loading branch information
1 parent
d995d6c
commit 3e5dadc
Showing
16 changed files
with
586 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
"description": "Getting Started Guides", | ||
"type": "generated-index" | ||
}, | ||
"position": 2 | ||
"position": 3 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {InstallXyoOptions} from './installation' |
171 changes: 171 additions & 0 deletions
171
docs/getting-started/components/installation/cli-tabs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
import { Paper, alpha, styled, useTheme } from '@mui/material' | ||
import Box, { BoxProps } from '@mui/material/Box' | ||
import Tab from '@mui/material/Tab' | ||
import Tabs from '@mui/material/Tabs' | ||
import Typography from '@mui/material/Typography' | ||
import * as React from 'react' | ||
|
||
|
||
interface SingleCliTabProps { | ||
tabTitle: string | ||
tabContent: string | ||
} | ||
|
||
interface CliTabsProps extends BoxProps { | ||
tabs: SingleCliTabProps[] | ||
} | ||
|
||
interface TabPanelProps { | ||
children?: React.ReactNode | ||
index: number | ||
value: number | ||
} | ||
|
||
|
||
function TabPanel(props: TabPanelProps) { | ||
const { children, value, index, ...other } = props | ||
|
||
return ( | ||
<div | ||
role="tabpanel" | ||
hidden={value !== index} | ||
id={`simple-tabpanel-${index}`} | ||
aria-labelledby={`simple-tab-${index}`} | ||
{...other} | ||
> | ||
{value === index && ( | ||
<Box sx={{ p: 3 }}> | ||
<Typography>{children}</Typography> | ||
</Box> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
|
||
const AntTabs = styled(Tabs)({ | ||
borderBottom: '1px solid #e8e8e8', | ||
'& .MuiTabs-indicator': { | ||
backgroundColor: '#1890ff', | ||
}, | ||
}); | ||
|
||
const AntTab = styled((props: StyledTabProps) => <Tab disableRipple {...props} />)( | ||
({ theme }) => ({ | ||
textTransform: 'none', | ||
minWidth: 0, | ||
[theme.breakpoints.up('sm')]: { | ||
minWidth: 0, | ||
}, | ||
fontWeight: theme.typography.fontWeightRegular, | ||
marginRight: theme.spacing(1), | ||
color: 'rgba(0, 0, 0, 0.85)', | ||
fontFamily: [ | ||
'-apple-system', | ||
'BlinkMacSystemFont', | ||
'"Segoe UI"', | ||
'Roboto', | ||
'"Helvetica Neue"', | ||
'Arial', | ||
'sans-serif', | ||
'"Apple Color Emoji"', | ||
'"Segoe UI Emoji"', | ||
'"Segoe UI Symbol"', | ||
].join(','), | ||
'&:hover': { | ||
color: '#40a9ff', | ||
opacity: 1, | ||
}, | ||
'&.Mui-selected': { | ||
color: '#1890ff', | ||
fontWeight: theme.typography.fontWeightMedium, | ||
}, | ||
'&.Mui-focusVisible': { | ||
backgroundColor: '#d1eaff', | ||
}, | ||
}), | ||
); | ||
|
||
interface StyledTabsProps { | ||
children?: React.ReactNode; | ||
value: number; | ||
onChange: (event: React.SyntheticEvent, newValue: number) => void; | ||
} | ||
|
||
const StyledTabs = styled((props: StyledTabsProps) => ( | ||
<Tabs | ||
{...props} | ||
TabIndicatorProps={{ children: <span className="MuiTabs-indicatorSpan" /> }} | ||
/> | ||
))({ | ||
'& .MuiTabs-indicator': { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
backgroundColor: 'transparent', | ||
}, | ||
'& .MuiTabs-indicatorSpan': { | ||
maxWidth: 40, | ||
width: '100%', | ||
backgroundColor: '#635ee7', | ||
}, | ||
}); | ||
|
||
interface StyledTabProps { | ||
label: string; | ||
} | ||
|
||
const StyledTab = styled((props: StyledTabProps) => ( | ||
<Tab disableRipple {...props} /> | ||
))(({ theme }) => ({ | ||
textTransform: 'none', | ||
fontWeight: theme.typography.fontWeightBold, | ||
fontSize: theme.typography.pxToRem(15), | ||
marginRight: theme.spacing(1), | ||
color: 'rgba(255, 255, 255, 0.7)', | ||
'&.Mui-selected': { | ||
color: '#fff', | ||
}, | ||
'&.Mui-focusVisible': { | ||
backgroundColor: 'rgba(100, 95, 228, 0.32)', | ||
}, | ||
})); | ||
|
||
|
||
|
||
function a11yProps(index: number) { | ||
return { | ||
id: `simple-tab-${index}`, | ||
'aria-controls': `simple-tabpanel-${index}`, | ||
} | ||
} | ||
export const CliTabs: React.FC<CliTabsProps> = ({tabs, ...props}) => { | ||
const [value, setValue] = React.useState(0) | ||
const theme = useTheme() | ||
const handleChange = (event: React.SyntheticEvent, newValue: number) => { | ||
setValue(newValue) | ||
} | ||
|
||
return ( | ||
<Box sx={{ width: '100%' }} {...props}> | ||
<Paper sx={{ bgcolor: '#252529', color: '#ffffff', borderRadius: '10px'}}> | ||
<Box style={{borderBottom: 2, borderColor: 'lightgray', backgroundColor: alpha('#ffffff', 0.1), borderRadius: '10px 10px 0px 0px'}} > | ||
<StyledTabs value={value} onChange={handleChange} aria-label="basic tabs example"> | ||
{tabs.map((item, index) => { | ||
return ( | ||
<StyledTab key={`${index}-tab`} label={item.tabTitle} {...a11yProps(index)}/> | ||
) | ||
})} | ||
</StyledTabs> | ||
</Box> | ||
{tabs.map((item, index) => { | ||
return ( | ||
<TabPanel key={`${index}-tab-panel`} value={value} index={index}> | ||
<Typography variant="body1"> | ||
{item.tabContent} | ||
</Typography> | ||
</TabPanel>) | ||
})} | ||
</Paper> | ||
</Box> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './install-xyo' |
82 changes: 82 additions & 0 deletions
82
docs/getting-started/components/installation/install-xyo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import * as React from 'react' | ||
import Tabs from '@mui/material/Tabs' | ||
import Tab from '@mui/material/Tab' | ||
import Typography from '@mui/material/Typography' | ||
import Box from '@mui/material/Box' | ||
import { CliTabs } from './cli-tabs' | ||
import { Link } from '@mui/material' | ||
|
||
interface TabPanelProps { | ||
children?: React.ReactNode | ||
index: number | ||
value: number | ||
} | ||
|
||
function TabPanel(props: TabPanelProps) { | ||
const { children, value, index, ...other } = props | ||
|
||
return ( | ||
<div | ||
role="tabpanel" | ||
hidden={value !== index} | ||
id={`simple-tabpanel-${index}`} | ||
aria-labelledby={`simple-tab-${index}`} | ||
{...other} | ||
> | ||
{value === index && ( | ||
<Box paddingTop={3}> | ||
<Typography>{children}</Typography> | ||
</Box> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
function a11yProps(index: number) { | ||
return { | ||
id: `simple-tab-${index}`, | ||
'aria-controls': `simple-tabpanel-${index}`, | ||
} | ||
} | ||
export const InstallXyoOptions: React.FC = (props) => { | ||
const [value, setValue] = React.useState(0) | ||
|
||
const handleChange = (event: React.SyntheticEvent, newValue: number) => { | ||
setValue(newValue) | ||
} | ||
|
||
return ( | ||
<Box sx={{ width: '100%' }}> | ||
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}> | ||
<Tabs value={value} onChange={handleChange} aria-label="basic tabs example"> | ||
<Tab label="Javascript" {...a11yProps(0)} /> | ||
<Tab label="React" {...a11yProps(1)} /> | ||
<Tab label="Android/Kotlin/Java" {...a11yProps(2)} /> | ||
<Tab label="Swift/iOS/OSX" {...a11yProps(3)} /> | ||
</Tabs> | ||
</Box> | ||
<TabPanel value={value} index={0}> | ||
<CliTabs tabs={[{tabTitle: 'npm', tabContent:'npm i --save @xyo-network/sdk-xyo-client-js'}, | ||
{tabTitle: 'yarn', tabContent:'yarn add @xyo-network/sdk-xyo-client-js'}]}/> | ||
</TabPanel> | ||
<TabPanel value={value} index={1}> | ||
<CliTabs tabs={[{tabTitle: 'npm', tabContent:'npm i --save @xyo-network/sdk-xyo-react'}, | ||
{tabTitle: 'yarn', tabContent:'yarn add @xyo-network/sdk-xyo-react'}]}/> | ||
</TabPanel> | ||
<TabPanel value={value} index={2}> | ||
<Typography variant='body1'>You can find the instructions for the XYO Android SDK{' '} | ||
<Link href="https://jitpack.io/#xyoraclenetwork/sdk-xyo-client-android" target="_blank"> | ||
here | ||
</Link>. | ||
</Typography> | ||
</TabPanel> | ||
<TabPanel value={value} index={3}> | ||
<Typography variant='body1'>You can find the instructions for the XYO Android SDK{' '} | ||
<Link href="/sdks/swift"> | ||
here | ||
</Link>. | ||
</Typography> | ||
</TabPanel> | ||
</Box> | ||
) | ||
} |
4 changes: 2 additions & 2 deletions
4
docs/getting-started/exercises.md → docs/getting-started/exercises-ext.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.