Skip to content
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
70 changes: 23 additions & 47 deletions src/components/issues/IssueHeaderCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ const IssueHeaderCard: React.FC<IssueHeaderCardProps> = ({ issue }) => {
const usdEstimate = hasPrices
? formatAlphaToUsd(issue.targetBounty, taoPrice, alphaPrice)
: null;
const metaLabelSx = {
fontSize: '0.7rem',
color: alpha(theme.palette.common.white, TEXT_OPACITY.tertiary),
textTransform: 'uppercase' as const,
letterSpacing: '0.5px',
mb: 0.9,
};

return (
<Card
Expand Down Expand Up @@ -94,9 +101,11 @@ const IssueHeaderCard: React.FC<IssueHeaderCardProps> = ({ issue }) => {
sx={{
fontFamily:
'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',
fontSize: '1.5rem',
fontSize: { xs: '1.2rem', sm: '1.5rem' },
fontWeight: 600,
color: 'text.primary',
wordBreak: 'break-word',
overflowWrap: 'anywhere',
}}
>
{issue.title}
Expand All @@ -106,26 +115,20 @@ const IssueHeaderCard: React.FC<IssueHeaderCardProps> = ({ issue }) => {
{/* Bounty and metadata row */}
<Box
sx={{
display: 'flex',
alignItems: 'flex-start',
flexDirection: { xs: 'column', sm: 'row' },
columnGap: { sm: 4 },
display: 'grid',
gridTemplateColumns: { xs: '1fr 1fr', sm: 'auto auto auto' },
columnGap: { xs: 2, sm: 4 },
rowGap: { xs: 1.75, sm: 2 },
flexWrap: { xs: 'nowrap', sm: 'wrap' },
alignItems: 'flex-start',
}}
>
<Box
sx={{ width: { xs: '100%', sm: 'auto' }, minWidth: { sm: 170 } }}
sx={{
gridColumn: { xs: '1 / -1', sm: 'auto' },
minWidth: { sm: 170 },
}}
>
<Typography
sx={{
fontSize: '0.7rem',
color: alpha(theme.palette.common.white, TEXT_OPACITY.tertiary),
textTransform: 'uppercase',
letterSpacing: '0.5px',
mb: 0.5,
}}
>
<Typography sx={{ ...metaLabelSx, mb: 0.5 }}>
{issue.status === 'completed' ? 'Payout' : 'Bounty'}
</Typography>
{issue.status === 'registered' ? (
Expand Down Expand Up @@ -195,23 +198,8 @@ const IssueHeaderCard: React.FC<IssueHeaderCardProps> = ({ issue }) => {
</Box>

{issue.authorLogin && (
<Box
sx={{ width: { xs: '100%', sm: 'auto' }, minWidth: { sm: 140 } }}
>
<Typography
sx={{
fontSize: '0.7rem',
color: alpha(
theme.palette.common.white,
TEXT_OPACITY.tertiary,
),
textTransform: 'uppercase',
letterSpacing: '0.5px',
mb: 0.9,
}}
>
Author
</Typography>
<Box sx={{ minWidth: { sm: 140 } }}>
<Typography sx={metaLabelSx}>Author</Typography>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
<Avatar
src={getGithubAvatarSrc(issue.authorLogin)}
Expand All @@ -235,20 +223,8 @@ const IssueHeaderCard: React.FC<IssueHeaderCardProps> = ({ issue }) => {
</Box>
)}

<Box
sx={{ width: { xs: '100%', sm: 'auto' }, minWidth: { sm: 160 } }}
>
<Typography
sx={{
fontSize: '0.7rem',
color: alpha(theme.palette.common.white, TEXT_OPACITY.tertiary),
textTransform: 'uppercase',
letterSpacing: '0.5px',
mb: 0.9,
}}
>
Created
</Typography>
<Box sx={{ minWidth: { sm: 160 } }}>
<Typography sx={metaLabelSx}>Created</Typography>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.75 }}>
<CalendarTodayOutlinedIcon
sx={{
Expand Down
8 changes: 5 additions & 3 deletions src/components/issues/IssueSubmissionsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
CircularProgress,
Typography,
alpha,
useMediaQuery,
useTheme,
} from '@mui/material';
import CalendarTodayOutlinedIcon from '@mui/icons-material/CalendarTodayOutlined';
Expand All @@ -22,6 +21,10 @@ import {
type DataTableColumn,
} from '../../components/common/DataTable';

// Sum of the fixed column widths below; keeps the table from compressing
// into an unreadable layout on narrow viewports (scrolls horizontally instead).
const SUBMISSIONS_TABLE_MIN_WIDTH = 832;

interface IssueSubmissionsTableProps {
submissions: IssueSubmission[] | undefined;
isLoading: boolean;
Expand All @@ -34,7 +37,6 @@ const IssueSubmissionsTable: React.FC<IssueSubmissionsTableProps> = ({
backLabel,
}) => {
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
const linkState = backLabel ? { backLabel } : undefined;
const winnerSubmission =
submissions?.find((submission) => submission.isWinner) ?? null;
Expand Down Expand Up @@ -441,7 +443,7 @@ const IssueSubmissionsTable: React.FC<IssueSubmissionsTableProps> = ({
<DataTable
columns={columns}
rows={otherSubmissions}
minWidth={isMobile ? 832 : undefined}
minWidth={SUBMISSIONS_TABLE_MIN_WIDTH}
getRowKey={(submission) =>
`${submission.repositoryFullName}-${submission.number}`
}
Expand Down
5 changes: 4 additions & 1 deletion src/pages/IssueDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ const IssueDetailsPage: React.FC = () => {
value={tabValue}
onChange={handleTabChange}
aria-label="issue details tabs"
variant="scrollable"
scrollButtons="auto"
sx={(theme) => ({
'& .MuiTab-root': {
color: STATUS_COLORS.open,
Expand All @@ -153,7 +155,8 @@ const IssueDetailsPage: React.FC = () => {
textTransform: 'none',
fontWeight: 500,
minHeight: '48px',
fontSize: '14px',
fontSize: { xs: '13px', sm: '14px' },
px: { xs: 1.5, sm: 2 },
'&.Mui-selected': {
color: theme.palette.text.primary,
fontWeight: 600,
Expand Down
Loading