Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

リストとメッセージページのタブのスタイル変更 #485

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/pages/ListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export function ListPage(): JSX.Element {
timelineRef.current?.scrollToIndex(0, { align: 'start', smooth: true })
}
}}
sx={{ fontSize: '0.9rem', padding: '0', textTransform: 'none' }}
/>
))}
</Tabs>
Expand Down
30 changes: 24 additions & 6 deletions src/pages/MessagePage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Divider, List, Paper, Tab, Tabs, Typography } from '@mui/material'
import { Box, Divider, List, Paper, Tab, Tabs, Typography, useMediaQuery, useTheme } from '@mui/material'
import { useParams } from 'react-router-dom'
import { useApi } from '../context/api'
import { useEffect, useState } from 'react'
Expand Down Expand Up @@ -40,6 +40,8 @@ export function MessagePage(): JSX.Element {
const [replyTo, setReplyTo] = useState<Message<ReplyMessageSchema> | null>(null)

const tab = (location.hash.slice(1) as 'replies' | 'reroutes' | 'favorites' | 'reactions') || 'replies'
const theme = useTheme()
const isMobileSize = useMediaQuery(theme.breakpoints.down('sm'))

useEffect(() => {
setMessage(null)
Expand Down Expand Up @@ -156,12 +158,28 @@ export function MessagePage(): JSX.Element {
}}
textColor="secondary"
indicatorColor="secondary"
variant="scrollable"
variant={isMobileSize ? 'fullWidth' : 'standard'}
>
<Tab value="replies" label="Replies" />
<Tab value="reroutes" label="Reroutes" />
<Tab value="favorites" label="Favorites" />
<Tab value="reactions" label="Reactions" />
<Tab
value="replies"
label="Replies"
sx={{ fontSize: '0.9rem', padding: '0', textTransform: 'none', minWidth: { xs: '0', sm: '80px' } }}
/>
<Tab
value="reroutes"
label="Reroutes"
sx={{ fontSize: '0.9rem', padding: '0', textTransform: 'none', minWidth: { xs: '0', sm: '80px' } }}
/>
<Tab
value="favorites"
label="Favorites"
sx={{ fontSize: '0.9rem', padding: '0', textTransform: 'none', minWidth: { xs: '0', sm: '80px' } }}
/>
<Tab
value="reactions"
label="Reactions"
sx={{ fontSize: '0.9rem', padding: '0', textTransform: 'none', minWidth: { xs: '0', sm: '80px' } }}
/>
</Tabs>
<Divider />
{tab === 'replies' && (
Expand Down
Loading