Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
boynextdoor committed Mar 13, 2024
1 parent cd2a2cb commit 4ff6389
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/Components/DataPoints/DataPoints.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export async function loader() {
programs = Object.values(programs).flat().filter(program => program.Applicants.length > 0);
const recordIDs = programs.map(program => program.Applicants.map(applicant => applicant + "|" + program.ProgramID)).flat();
let records = Object.values(await getRecordByRecordIDs(recordIDs));
programs = programs.map(program => program.ProgramID);
const programIDs = programs.map(program => program.ProgramID);
records = records.sort((a, b) => {
return programs.indexOf(a.ProgramID) - programs.indexOf(b.ProgramID);
return programIDs.indexOf(a.ProgramID) - programIDs.indexOf(b.ProgramID);
});
return {records};
}
Expand Down
61 changes: 38 additions & 23 deletions src/Components/Profile/ProfileApplicant/ProfileApplicantPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ListItemIcon, ListItemText, TextField,
Paper, Slider, styled, Typography, Divider, Tooltip, Input, ButtonGroup,
} from "@mui/material";
import {Add, Delete, Edit, Refresh} from "@mui/icons-material";
import {Add, Delete, Download, Edit, Refresh} from "@mui/icons-material";

Check warning on line 10 in src/Components/Profile/ProfileApplicant/ProfileApplicantPage.jsx

View workflow job for this annotation

GitHub Actions / qodana

Unused import

Unused import specifier Download
import "./ProfileApplicantPage.css";
import {Link} from 'react-router-dom';
import {
Expand Down Expand Up @@ -338,32 +338,47 @@ function BasicInfoBlock({avatarUrl, contact, applicant, records, editable}) {
editable={editable && isAuth}/>
</ContentCenteredGrid>
</Grid2>
<ContentCenteredGrid xs={12}>
<ContentCenteredGrid xs={12} sx={{gap: Object.entries(contact).length ? 0 : '1rem'}}>
<Typography variant="subtitle1" sx={{fontWeight: 'bold'}}>
联系方式:
</Typography>
<ButtonGroup>
{Object.entries(contact).length ? Object.entries(contact).map(([key, value]) => {
const Icon = contactIcons[key];
if (value === "") {
return null;
}
return (
<Tooltip title={key} key={key} arrow>
<IconButton
onClick={async () => {
await navigator.clipboard.writeText(value)
alert(`已复制${value}到剪贴板!`)
}}
>
{["QQ", "WeChat"].includes(key) ? <FontAwesomeIcon icon={Icon} fontSize='medium'/> :
<Icon/>}
</IconButton>
</Tooltip>
)
}) : "暂无"}
</ButtonGroup>
{Object.entries(contact).length ?
<ButtonGroup>
{Object.entries(contact).map(([key, value]) => {
const Icon = contactIcons[key];
if (value === "") {
return null;
}
return (
<Tooltip title={key} key={key} arrow>
<IconButton
onClick={async () => {
await navigator.clipboard.writeText(value)

Check notice on line 356 in src/Components/Profile/ProfileApplicant/ProfileApplicantPage.jsx

View workflow job for this annotation

GitHub Actions / qodana

Signature mismatch

Argument type unknown is not assignable to parameter type string
alert(`已复制${value}到剪贴板!`)
}}
>
{["QQ", "WeChat"].includes(key) ?
<FontAwesomeIcon icon={Icon} fontSize='medium'/> :
<Icon/>}
</IconButton>
</Tooltip>
)
})}
</ButtonGroup> : "暂无"}
</ContentCenteredGrid>
{/*<ContentCenteredGrid xs={12} sx={{gap: '1rem'}}>*/}
{/* <Typography variant="subtitle1" sx={{fontWeight: 'bold'}}>*/}
{/* 申请材料:*/}
{/* </Typography>*/}
{/* <ButtonGroup>*/}
{/* <Button endIcon={<Download/>} size='small'>*/}
{/* CV*/}
{/* </Button>*/}
{/* <Button endIcon={<Download/>} size='small'>*/}
{/* SoP/PS*/}
{/* </Button>*/}
{/* </ButtonGroup>*/}
{/*</ContentCenteredGrid>*/}
<ContentCenteredGrid xs={12} sx={{gap: '1rem'}}>
<Typography variant="subtitle1" sx={{fontWeight: 'bold'}}>
最终去向:
Expand Down

0 comments on commit 4ff6389

Please sign in to comment.