Skip to content

Commit

Permalink
Merge pull request #271 from scottbenton/fix/custom-track-issue
Browse files Browse the repository at this point in the history
Fix/custom track issue
  • Loading branch information
scottbenton authored Oct 30, 2023
2 parents a9c04dc + b094d66 commit fb6de3b
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 133 deletions.
173 changes: 71 additions & 102 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
"preview": "vite preview"
},
"dependencies": {
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fontsource/bebas-neue": "^5.0.12",
"@fontsource/rubik": "^4.5.13",
"@fontsource/staatliches": "^4.5.9",
"@hocuspocus/transformer": "^2.4.0",
"@iconify-icons/game-icons": "^1.2.1",
"@mui/icons-material": "^5.11.0",
"@mui/lab": "^5.0.0-alpha.115",
"@mui/material": "^5.11.3",
"@mui/icons-material": "^5.14.15",
"@mui/lab": "^5.0.0-alpha.150",
"@mui/material": "^5.14.15",
"@tiptap/extension-collaboration": "^2.0.3",
"@tiptap/extension-collaboration-cursor": "^2.0.3",
"@tiptap/extension-placeholder": "^2.0.0-beta.218",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,17 @@ export function CustomMoveDialog(props: CustomMoveDialogProps) {
</FormControl>
</Box>
<Autocomplete
multiple
//@ts-ignore
multiple={true}
limitTags={2}
options={Object.values(combinedOracles)}
//@ts-ignore
getOptionLabel={(oracle) => oracle.Title.Standard}
renderInput={(params) => (
<TextField {...params} label={"Oracles"} />
)}
value={getOraclesFromIds(form.values.oracleIds)}
//@ts-ignore
onChange={(evt, value) => {
const ids = Array.isArray(value)
? value.map((oracle) => oracle.$id)
Expand Down
55 changes: 33 additions & 22 deletions src/components/features/charactersAndCampaigns/CustomTrack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Theme,
ToggleButton,
ToggleButtonGroup,
ToggleButtonProps,
Typography,
} from "@mui/material";
import { CustomTrack as ICustomTrack } from "types/CustomTrackSettings.type";
Expand All @@ -17,6 +18,35 @@ export interface CustomTrackProps {
loading?: boolean;
}

const FakeToggleButton = (props: ToggleButtonProps) => {
const { children, className } = props;

return (
<Box
className={className}
sx={(theme) => ({
borderStyle: "solid",
borderColor: theme.palette.divider,
borderWidth: 1,
borderLeftWidth: 0,
px: 0.5,
display: "flex",
alignItems: "center",
justifyContent: "center",
bgcolor: theme.palette.grey[500],
color: theme.palette.darkGrey.contrastText,
})}
>
<Typography
fontFamily={(theme) => theme.fontFamilyTitle}
variant={"subtitle1"}
>
{children}
</Typography>
</Box>
);
};

export function CustomTrack(props: CustomTrackProps) {
const { sx, customTrack, value, onChange, disabled, loading } = props;
return (
Expand Down Expand Up @@ -85,28 +115,9 @@ export function CustomTrack(props: CustomTrackProps) {
{cell.value}
</ToggleButton>
) : (
<Box
key={index}
sx={(theme) => ({
borderStyle: "solid",
borderColor: theme.palette.divider,
borderWidth: 1,
borderLeftWidth: 0,
px: 0.5,
display: "flex",
alignItems: "center",
justifyContent: "center",
bgcolor: theme.palette.grey[500],
color: theme.palette.darkGrey.contrastText,
})}
>
<Typography
fontFamily={(theme) => theme.fontFamilyTitle}
variant={"subtitle1"}
>
{cell.value}
</Typography>
</Box>
<FakeToggleButton key={index} value={cell.value}>
{cell.value}
</FakeToggleButton>
)
)}
</ToggleButtonGroup>
Expand Down
Loading

0 comments on commit fb6de3b

Please sign in to comment.