Skip to content

Commit

Permalink
refactor: improved naming, removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsebn committed Oct 7, 2023
1 parent 9fe0b41 commit aa0410b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Button, ButtonGroup as MuiButtonGroup } from '@mui/material';
import { Box, Button } from '@mui/material';
import type { ButtonProps } from '@mui/material/Button';

import { styled } from '@mui/material/styles';
Expand All @@ -7,7 +7,7 @@ interface SelectedButtonProps extends ButtonProps {
selected: string;
}

export const ButtonContainer = styled(Box)(({ theme }) => ({
export const ButtonGroupContainer = styled(Box)(({ theme }) => ({
display: 'flex',
padding: '4px',
alignItems: 'center',
Expand All @@ -17,7 +17,7 @@ export const ButtonContainer = styled(Box)(({ theme }) => ({
borderRadius: '20px',
}));

export const SelectedButton = styled(Button)<SelectedButtonProps>(
export const SelectButton = styled(Button)<SelectedButtonProps>(
({ theme, selected }) => ({
borderRadius: '20px',
flex: 1,
Expand All @@ -32,5 +32,3 @@ export const SelectedButton = styled(Button)<SelectedButtonProps>(
boxShadow: selected === 'Custom' || selected === 'Bookmarks' ? 'none' : '',
}),
);

export const ButtonGroup = styled(MuiButtonGroup)(({ theme }) => ({}));
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import {
ButtonContainer,
SelectedButton,
ButtonGroupContainer,
SelectButton,
} from './BookmarkLandingButtonGroup.styled';

export const BookmarkLandingButtonGroup = () => {
const { t } = useTranslation();
const [selected, setSelected] = useState('Custom');

return (
<ButtonContainer>
<SelectedButton selected={selected} onClick={() => setSelected('Custom')}>
<ButtonGroupContainer>
<SelectButton selected={selected} onClick={() => setSelected('Custom')}>
{t('button.custom')}
</SelectedButton>
<SelectedButton
</SelectButton>
<SelectButton
selected={selected}
onClick={() => setSelected('Bookmarks')}
>
{t('button.bookmarks')}
</SelectedButton>
</ButtonContainer>
</SelectButton>
</ButtonGroupContainer>
);
};

0 comments on commit aa0410b

Please sign in to comment.