Skip to content

Commit

Permalink
Merge pull request #2 from notV3NOM/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
notV3NOM authored Jan 24, 2024
2 parents 8582fff + 8d5c5d2 commit 4e0d085
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 14 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ Dev Setup :
git clone --recursive https://github.com/notV3NOM/genshin-optimizer.git
yarn
npx nx serve frontend
```

Tests :

```bash
npx nx run frontend:test
```

Lint :

```bash
npx nx format write
```

Expand All @@ -15,3 +25,9 @@ Production Build :
```bash
npx nx run frontend:build-webpack:production
```

Changelog :

- Hide lesser used pages
- Dark Mode
- Additional sort on generated builds by any target
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ export default function StatDisplayComponent({
<Box sx={{ mr: -1, mb: -1 }}>
<Masonry columns={{ xs: 1, sm: 2, md: 3, xl: 4 }} spacing={1}>
{sections.map(([key, Nodes]) => (
<Section key={key} displayNs={Nodes} sectionKey={key} />
<Section
key={key}
displayNs={Nodes}
sectionKey={key}
sortBase={sortOptions?.sortBase}
/>
))}
</Masonry>
</Box>
Expand All @@ -58,9 +63,11 @@ export default function StatDisplayComponent({
function Section({
displayNs,
sectionKey,
sortBase,
}: {
displayNs: DisplaySub<NodeDisplay>
sectionKey: string
sortBase: string[]
}) {
const optimizationTarget = useContext(OptimizationTargetContext)
const { data, oldData } = useContext(DataContext)
Expand Down Expand Up @@ -100,6 +107,9 @@ function Section({
JSON.stringify(optimizationTarget) ===
JSON.stringify([sectionKey, nodeKey])
}
secondaryEmphasize={
JSON.stringify(sortBase) === JSON.stringify([sectionKey, nodeKey])
}
/>
))}
</FieldDisplayList>
Expand Down
8 changes: 7 additions & 1 deletion apps/frontend/src/app/Components/FieldDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@ export function NodeFieldDisplay({
oldValue,
component,
emphasize,
secondaryEmphasize,
}: {
node: NodeDisplay
oldValue?: number
component?: React.ElementType
emphasize?: boolean
secondaryEmphasize?: boolean
}) {
const { data } = useContext(DataContext)
const { setFormulaData } = useContext(FormulaDataContext)
Expand Down Expand Up @@ -142,7 +144,11 @@ export function NodeFieldDisplay({
display: 'flex',
justifyContent: 'space-between',
gap: 1,
boxShadow: emphasize ? '0px 0px 0px 2px red inset' : undefined,
boxShadow: emphasize
? '0px 0px 0px 2px red inset'
: secondaryEmphasize
? '0px 0px 0px 2px yellow inset'
: undefined,
}}
component={component}
>
Expand Down
22 changes: 10 additions & 12 deletions apps/frontend/src/app/PageArtifact/ArtifactEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -796,18 +796,16 @@ export default function ArtifactEditor({
)}
</Grid>
<Grid item>
{process.env.NODE_ENV === 'development' && (
<Button
color="info"
startIcon={<Shuffle />}
onClick={() =>
artifactDispatch({
type: 'overwrite',
artifact: randomizeArtifact(),
})
}
>{t`editor.btnRandom`}</Button>
)}
<Button
color="info"
startIcon={<Shuffle />}
onClick={() =>
artifactDispatch({
type: 'overwrite',
artifact: randomizeArtifact(),
})
}
>{t`editor.btnRandom`}</Button>
</Grid>
{old && oldType !== 'edit' && (
<Grid item>
Expand Down

0 comments on commit 4e0d085

Please sign in to comment.