-
Notifications
You must be signed in to change notification settings - Fork 4
Improve Styles, including Dark Mode #258
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
base: dev
Are you sure you want to change the base?
Changes from all commits
f8128b8
186bf23
454a2cc
7dc0c55
c2463eb
9ecd09d
edbf0cd
c3f164e
d5a3433
6492d60
cafb3b1
02aa1b1
6eb65fd
7bb076c
67a3f3d
10d9cae
e42d28c
97b1e72
81d6d67
c37e79a
4f1a08a
ef11d27
375a1b7
f7644a2
60f1374
ff5ecd5
0ee22b9
26274b1
4fccbf4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import React from "react"; | ||
| import InputLabel from '@mui/material/InputLabel'; | ||
| import MenuItem from '@mui/material/MenuItem'; | ||
| import FormControl from '@mui/material/FormControl'; | ||
| import Select, { SelectChangeEvent } from '@mui/material/Select'; | ||
|
|
||
| import { useGlobalContext } from "../context/GlobalContext"; | ||
|
|
||
| export default function ThemeMenu() { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add a test for this component once it is finalized and before we merge this PR. |
||
| const { | ||
| state: { userTheme }, | ||
| action: { setUserTheme }, | ||
| } = useGlobalContext(); | ||
|
|
||
| function changeTheme(e) { | ||
| setUserTheme(e.target.value); | ||
| } | ||
|
|
||
| return ( | ||
| <FormControl className="user-theme__menu"> | ||
| <InputLabel id="user-theme__label">Theme</InputLabel> | ||
| <Select | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When it comes time to test this, take a look at the test for my bulk editor -- it's a bit tricky to test MUI select controls, but that test does it successfully. (You have to trigger a MouseUp action, if I remember correctly...) |
||
| id="user-theme" | ||
| value={userTheme} | ||
| label="Theme" | ||
| labelId="user-theme__label" | ||
| onChange={changeTheme} | ||
| > | ||
| <MenuItem value={"system"}>System</MenuItem> | ||
| <MenuItem value={"light"}>Light</MenuItem> | ||
| <MenuItem value={"dark"}>Dark</MenuItem> | ||
| </Select> | ||
| </FormControl> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ const ObjectButtonBar = ({ pid }: ObjectButtonBarProps): React.ReactElement => { | |
| <ObjectStatus pid={pid} /> | ||
| <EditParentsButton pid={pid} /> | ||
| <button onClick={() => clearPidFromChildListStorage(pid)}> | ||
| <Refresh style={{ height: "14px" }} titleAccess="Refresh children" /> | ||
| <Refresh style={{ height: "20px", verticalAlign: "sub" }} titleAccess="Refresh children" /> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we give this a class and move the styling to CSS? I'm pretty sure the direct style here was just my laziness, but if we're going to get fancier, maybe we should do things "the right way." |
||
| </button> | ||
| <ObjectPreviewButton pid={pid} /> | ||
| <DeleteObjectButton pid={pid} /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,29 @@ | ||
| .active, | ||
| .inactive, | ||
| .deleted, | ||
| .unknown { | ||
| display: inline-flex; | ||
| width: 100px; | ||
| text-align: left; | ||
| } | ||
|
|
||
| .indicator__label { | ||
| flex: 1 1 0%; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .active .indicator { | ||
| color: green; | ||
| color: var(--object-status-active); | ||
| } | ||
|
|
||
| .inactive .indicator { | ||
| color: yellow; | ||
| color: var(--object-status-inactive); | ||
| } | ||
|
|
||
| .deleted .indicator { | ||
| color: red; | ||
| color: var(--object-status-deleted); | ||
| } | ||
|
|
||
| .unknown .indicator { | ||
| color: gray; | ||
| } | ||
|
|
||
| .indicator { | ||
| text-shadow: -1px 1px 0 #000, 1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000; | ||
| color: var(--object-status-unknown); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,38 @@ | ||
| .childlist { | ||
| margin-block: 0.75rem; | ||
| } | ||
|
|
||
| .childlist__list { | ||
| margin-block: 0; | ||
| padding-inline: 0; | ||
| list-style-type: none; | ||
| background-color: white; | ||
| } | ||
| .childlist__list > li { | ||
| margin-block: 0; | ||
| border-block-start: 1px solid var(--page-list-border); | ||
| } | ||
|
|
||
| .childlist__item { | ||
| margin-block: 0; | ||
| padding: 0.25rem; | ||
| } | ||
|
|
||
| .childlist__expandicon { | ||
| vertical-align: bottom; | ||
| } | ||
|
|
||
| /* Nested */ | ||
|
|
||
| .childlist__list .childlist { | ||
| margin-inline-start: 1.5rem; | ||
| } | ||
|
|
||
| .childlist li { | ||
| border-top: 1px solid gray; | ||
| /* Pagination alignment */ | ||
|
|
||
| .childlist .pagination { | ||
| margin-block-end: 1px; | ||
| } | ||
| .childlist .pagination li { | ||
| margin: 0; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're importing SelectChangeEvent but not using it.