Skip to content

Commit

Permalink
Feat/update copies (#353)
Browse files Browse the repository at this point in the history
* update copies

* fix resposnive

* update community-settings

* update oci js sdk
  • Loading branch information
mehdi-torabiv authored Dec 4, 2024
1 parent 8de25d9 commit ddcbf2b
Show file tree
Hide file tree
Showing 13 changed files with 800 additions and 106 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"moment-timezone": "^0.5.38",
"next": "^14.2.18",
"next-router-mock": "^0.9.9",
"oci-js-sdk": "^1.6.0",
"oci-js-sdk": "^1.6.1",
"papaparse": "^5.4.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { capitalizeFirstChar } from '../../helpers/helper';
import { StorageService } from '../../services/StorageService';
import { ICommunityPlatfromProps } from '../../utils/interfaces';

const Header = () => {
const SwitchPlatform = () => {
const { community, selectedPlatform, handleSwitchPlatform } = useToken();
const [platforms, setPlatforms] = useState<ICommunityPlatfromProps[]>([]);

Expand Down Expand Up @@ -77,59 +77,53 @@ const Header = () => {
};

return (
<AppBar
position='sticky'
className='flex hidden flex-col rounded-br-xl bg-gray-background px-4 py-2 text-inherit shadow-inner md:block md:px-12'
>
<Stack direction='row' className='w-full space-x-1.5'>
<FormControl className='ml-auto flex flex-row items-center space-x-2'>
<Typography variant='caption' fontWeight='bold'>
Select Platform:
</Typography>
<TcIconWithTooltip tooltipText='Choose a platform to view community-related metrics for that platform.' />
<Select
variant='filled'
size='small'
value={selectedPlatform}
onChange={handlePlatformChange}
autoWidth
sx={{
paddingTop: 0,
paddingBottom: 0,
backgroundColor: 'white',
'.MuiSelect-select': {
paddingTop: '8px',
paddingBottom: '8px',
},
}}
disableUnderline
renderValue={(selected) => {
const selectedPlatformObj = platforms.find(
(platform) => platform.id === selected
);
return selectedPlatformObj ? (
<Box display='flex' alignItems='center'>
<TcCommunityPlatformIcon
size={28}
platform={
capitalizeFirstChar(selectedPlatformObj.name) as string
}
/>
<ListItemText className='pl-2'>
{capitalizeFirstChar(selectedPlatformObj.name)}
</ListItemText>
</Box>
) : (
'Select Platform'
);
}}
>
{platformOptions}
</Select>
</FormControl>
</Stack>
</AppBar>
<Stack direction='row' className='w-full space-x-1.5'>
<FormControl className='ml-auto flex flex-row items-center space-x-2'>
<Typography variant='caption' fontWeight='bold'>
Select Platform:
</Typography>
<TcIconWithTooltip tooltipText='Choose a platform to view community-related metrics for that platform.' />
<Select
variant='filled'
size='small'
value={selectedPlatform}
onChange={handlePlatformChange}
autoWidth
sx={{
paddingTop: 0,
paddingBottom: 0,
'.MuiSelect-select': {
paddingTop: '8px',
paddingBottom: '8px',
},
}}
disableUnderline
renderValue={(selected) => {
const selectedPlatformObj = platforms.find(
(platform) => platform.id === selected
);
return selectedPlatformObj ? (
<Box display='flex' alignItems='center'>
<TcCommunityPlatformIcon
size={28}
platform={
capitalizeFirstChar(selectedPlatformObj.name) as string
}
/>
<ListItemText className='pl-2'>
{capitalizeFirstChar(selectedPlatformObj.name)}
</ListItemText>
</Box>
) : (
'Select Platform'
);
}}
>
{platformOptions}
</Select>
</FormControl>
</Stack>
);
};

export default Header;
export default SwitchPlatform;
2 changes: 0 additions & 2 deletions src/layouts/defaultLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';

import Header from '../components/layouts/Header';
import TcPrompt from '../components/layouts/shared/TcPrompt';
import Sidebar from '../components/layouts/Sidebar';
import SidebarXs from '../components/layouts/xs/SidebarXs';
Expand All @@ -17,7 +16,6 @@ export const defaultLayout = ({ children }: IDefaultLayoutProps) => {
<Sidebar />
<SidebarXs />
<main className='flex-1 md:ml-[100px] xl:ml-[150px]'>
<Header />
{children}
</main>
</div>
Expand Down
Loading

0 comments on commit ddcbf2b

Please sign in to comment.