Skip to content

Commit

Permalink
fix(components): update tabs styles
Browse files Browse the repository at this point in the history
  • Loading branch information
FussuChalice authored Jan 12, 2025
1 parent 2454da5 commit b549e7a
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/components/scrollable_tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function ScrollableTabs({
className,
variant = 'scrollable',
minHeight = '48px',
tabsCountOnScreen = 0,
sx,
}: CustomTabProps) {
const { tabletDown } = useBreakpoints();
Expand Down Expand Up @@ -108,6 +109,10 @@ function ScrollableTabs({
iconPosition="end"
sx={{
minHeight,
width:
tabsCountOnScreen !== 0
? `calc(100% / ${tabsCountOnScreen})`
: 'auto',
fontSize: 16,
textTransform: 'none',
':not(&.Mui-selected)': { fontWeight: 400 },
Expand Down
6 changes: 6 additions & 0 deletions src/components/tabs/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ export interface CustomTabProps extends TabOwnProps {
*/
minHeight?: string;

/**
* The number of tabs that should be displayed on the screen at once.
* Useful for responsive layouts or custom tab implementations.
*/
tabsCountOnScreen?: number;

/**
* Custom styling applied to the tab component using MUI's `sx` prop.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ const MidweekMeeting = () => {
{noSchedule && <NoSchedule />}

{!noSchedule && (
<Box>
<Box
sx={{
marginTop: '8px',
}}
>
<WeekSelector value={value} onChange={handleValueChange} />

<WeekScheduleHeader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const OutgoingTalks = () => {
display: 'flex',
flexDirection: 'column',
gap: '16px',
marginTop: '8px',
}}
>
<ScheduleHeader />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const WeekSelector = (props: WeekSelectorProps) => {
<Box sx={{ marginTop: '-16px', marginBottom: '-32px' }}>
<ScrollableTabs
className="schedules-view-week-selector"
tabsCountOnScreen={8}
tabs={weeksTab}
value={currentTab}
onChange={handleWeekChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ const WeekendMeeting = () => {
<>
{noSchedule && <NoSchedule />}
{!noSchedule && (
<Box>
<Box
sx={{
marginTop: '8px',
}}
>
<WeekSelector value={value} onChange={handleValueChange} />

<WeekScheduleHeader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const PublisherTabs = () => {
background: 'unset',
borderRadius: 'unset',
},
'& span.MuiTouchRipple-root': { borderRadius: 'unset' },
'& span.MuiTouchRipple-root': { borderRadius: 'var(--radius-l)' },
}}
/>
</Card>
Expand Down
8 changes: 8 additions & 0 deletions src/pages/meetings/schedules/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ const WeeklySchedules = () => {
tabs={tabs}
value={value}
onChange={handleScheduleChange}
sx={{
'& button.Mui-selected': {
color: 'var(--accent-main)',
background: 'unset',
borderRadius: 'unset',
},
'& span.MuiTouchRipple-root': { borderRadius: 'var(--radius-l)' },
}}
/>
</Box>
</Box>
Expand Down

0 comments on commit b549e7a

Please sign in to comment.