3
0
mirror of https://github.com/Qortal/q-support.git synced 2025-02-11 17:55:50 +00:00

Merge pull request #3 from QortalSeth/main

Lightmode support
This commit is contained in:
Qortal Dev 2024-04-16 17:36:07 -06:00 committed by GitHub
commit b14fe2cf92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 121 additions and 77 deletions

View File

@ -1,6 +1,6 @@
import React, { useEffect, useRef, useState } from "react"; import React, { useEffect, useRef, useState } from "react";
import { import {
CrowdfundActionButton, ActionButton,
CrowdfundActionButtonRow, CrowdfundActionButtonRow,
CustomInputField, CustomInputField,
ModalBody, ModalBody,
@ -36,6 +36,7 @@ import {
ImagePublisher, ImagePublisher,
ImagePublisherRef, ImagePublisherRef,
} from "../common/ImagePublisher/ImagePublisher.tsx"; } from "../common/ImagePublisher/ImagePublisher.tsx";
import { ThemeButtonBright } from "../../pages/Home/Home-styles.tsx";
const uid = new ShortUniqueId(); const uid = new ShortUniqueId();
const shortuid = new ShortUniqueId({ length: 5 }); const shortuid = new ShortUniqueId({ length: 5 });
@ -448,15 +449,16 @@ export const EditIssue = () => {
</> </>
<CrowdfundActionButtonRow> <CrowdfundActionButtonRow>
<CrowdfundActionButton <ActionButton
onClick={() => { onClick={() => {
onClose(); onClose();
}} }}
variant="contained" variant="contained"
color="error" color="error"
sx={{ color: theme.palette.text.primary }}
> >
Cancel Cancel
</CrowdfundActionButton> </ActionButton>
<Box <Box
sx={{ sx={{
display: "flex", display: "flex",
@ -464,14 +466,20 @@ export const EditIssue = () => {
alignItems: "center", alignItems: "center",
}} }}
> >
<CrowdfundActionButton <ThemeButtonBright
variant="contained" variant="contained"
onClick={() => { onClick={() => {
publishQDNResource(); publishQDNResource();
}} }}
sx={{
fontFamily: "Montserrat",
fontSize: "16px",
fontWeight: 400,
letterSpacing: "0.2px",
}}
> >
Publish Publish
</CrowdfundActionButton> </ThemeButtonBright>
</Box> </Box>
</CrowdfundActionButtonRow> </CrowdfundActionButtonRow>
</ModalBody> </ModalBody>

View File

@ -7,9 +7,9 @@ import {
Button, Button,
Grid, Grid,
Rating, Rating,
Select,
TextField, TextField,
Typography, Typography,
Select
} from "@mui/material"; } from "@mui/material";
import AddPhotoAlternateIcon from "@mui/icons-material/AddPhotoAlternate"; import AddPhotoAlternateIcon from "@mui/icons-material/AddPhotoAlternate";
import { TimesSVG } from "../../assets/svgs/TimesSVG"; import { TimesSVG } from "../../assets/svgs/TimesSVG";
@ -159,8 +159,6 @@ export const CustomInputField = styled(TextField)(({ theme }) => ({
}, },
})); }));
export const CrowdfundTitle = styled(Typography)(({ theme }) => ({ export const CrowdfundTitle = styled(Typography)(({ theme }) => ({
fontFamily: "Copse", fontFamily: "Copse",
letterSpacing: "1px", letterSpacing: "1px",
@ -473,11 +471,11 @@ export const CrowdfundActionButtonRow = styled(Box)({
width: "100%", width: "100%",
}); });
export const CrowdfundActionButton = styled(Button)(({ theme }) => ({ export const ActionButton = styled(Button)(({ theme }) => ({
display: "flex", display: "flex",
alignItems: "center", alignItems: "center",
fontFamily: "Montserrat", fontFamily: "Montserrat",
fontSize: "16px", fontSize: "18px",
fontWeight: 400, fontWeight: 400,
letterSpacing: "0.2px", letterSpacing: "0.2px",
color: "white", color: "white",
@ -539,8 +537,8 @@ export const NoReviewsFont = styled(Typography)(({ theme }) => ({
export const StyledButton = styled(Button)(({ theme }) => ({ export const StyledButton = styled(Button)(({ theme }) => ({
fontWeight: 600, fontWeight: 600,
color: theme.palette.text.primary color: theme.palette.text.primary,
})) }));
export const CustomSelect = styled(Select)(({ theme }) => ({ export const CustomSelect = styled(Select)(({ theme }) => ({
fontFamily: "Mulish", fontFamily: "Mulish",
@ -549,34 +547,34 @@ export const CustomSelect = styled(Select)(({ theme }) => ({
fontWeight: 400, fontWeight: 400,
color: theme.palette.text.primary, color: theme.palette.text.primary,
backgroundColor: theme.palette.background.default, backgroundColor: theme.palette.background.default,
'& .MuiSelect-select': { "& .MuiSelect-select": {
padding: '12px', padding: "12px",
fontFamily: "Mulish", fontFamily: "Mulish",
fontSize: "19px", fontSize: "19px",
letterSpacing: "0px", letterSpacing: "0px",
fontWeight: 400, fontWeight: 400,
borderRadius: theme.shape.borderRadius, // Match border radius borderRadius: theme.shape.borderRadius, // Match border radius
}, },
'&:before': { "&:before": {
// Underline style // Underline style
borderBottomColor: theme.palette.mode === "light" ? "#B2BAC2" : "#c9cccf", borderBottomColor: theme.palette.mode === "light" ? "#B2BAC2" : "#c9cccf",
}, },
'&:after': { "&:after": {
// Underline style when focused // Underline style when focused
borderBottomColor: theme.palette.secondary.main, borderBottomColor: theme.palette.secondary.main,
}, },
'& .MuiOutlinedInput-root': { "& .MuiOutlinedInput-root": {
'& fieldset': { "& fieldset": {
borderColor: "#E0E3E7", borderColor: "#E0E3E7",
}, },
'&:hover fieldset': { "&:hover fieldset": {
borderColor: "#B2BAC2", borderColor: "#B2BAC2",
}, },
'&.Mui-focused fieldset': { "&.Mui-focused fieldset": {
borderColor: "#6F7E8C", borderColor: "#6F7E8C",
}, },
}, },
'& .MuiInputBase-root': { "& .MuiInputBase-root": {
fontFamily: "Mulish", fontFamily: "Mulish",
fontSize: "19px", fontSize: "19px",
letterSpacing: "0px", letterSpacing: "0px",

View File

@ -33,6 +33,7 @@ import {
ImagePublisher, ImagePublisher,
ImagePublisherRef, ImagePublisherRef,
} from "../common/ImagePublisher/ImagePublisher.tsx"; } from "../common/ImagePublisher/ImagePublisher.tsx";
import { ThemeButtonBright } from "../../pages/Home/Home-styles.tsx";
const uid = new ShortUniqueId(); const uid = new ShortUniqueId();
const shortuid = new ShortUniqueId({ length: 5 }); const shortuid = new ShortUniqueId({ length: 5 });
@ -427,6 +428,7 @@ export const PublishIssue = ({ editId, editContent }: NewCrowdfundProps) => {
}} }}
variant="contained" variant="contained"
color="error" color="error"
sx={{ color: theme.palette.text.primary }}
> >
Cancel Cancel
</ActionButton> </ActionButton>
@ -437,14 +439,20 @@ export const PublishIssue = ({ editId, editContent }: NewCrowdfundProps) => {
alignItems: "center", alignItems: "center",
}} }}
> >
<ActionButton <ThemeButtonBright
variant="contained" variant="contained"
onClick={() => { onClick={() => {
publishQDNResource(); publishQDNResource();
}} }}
sx={{
fontFamily: "Montserrat",
fontSize: "16px",
fontWeight: 400,
letterSpacing: "0.2px",
}}
> >
Publish Publish
</ActionButton> </ThemeButtonBright>
</Box> </Box>
</ActionButtonRow> </ActionButtonRow>
</ModalBody> </ModalBody>

View File

@ -475,7 +475,7 @@ export const ActionButton = styled(Button)(({ theme }) => ({
display: "flex", display: "flex",
alignItems: "center", alignItems: "center",
fontFamily: "Montserrat", fontFamily: "Montserrat",
fontSize: "16px", fontSize: "18px",
fontWeight: 400, fontWeight: 400,
letterSpacing: "0.2px", letterSpacing: "0.2px",
color: "white", color: "white",

View File

@ -1,10 +1,14 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { Button, List, ListItem, Typography, useTheme } from "@mui/material"; import { List, ListItem, Typography, useTheme } from "@mui/material";
import { import {
ModalContent, ModalContent,
ModalText, ModalText,
StyledModal, StyledModal,
} from "./BlockedNamesModal-styles"; } from "./BlockedNamesModal-styles";
import {
ThemeButton,
ThemeButtonBright,
} from "../../../pages/Home/Home-styles.tsx";
interface PostModalProps { interface PostModalProps {
open: boolean; open: boolean;
@ -69,30 +73,26 @@ export const BlockedNamesModal: React.FC<PostModalProps> = ({
}} }}
> >
<Typography>{name}</Typography> <Typography>{name}</Typography>
<Button <ThemeButton
sx={{ sx={{
backgroundColor: theme.palette.primary.main,
color: theme.palette.text.primary,
fontFamily: "Raleway", fontFamily: "Raleway",
}} }}
onClick={() => removeFromBlockList(name)} onClick={() => removeFromBlockList(name)}
> >
Remove Remove
</Button> </ThemeButton>
</ListItem> </ListItem>
))} ))}
</List> </List>
<Button <ThemeButtonBright
variant="contained" variant="contained"
onClick={onClose} onClick={onClose}
sx={{ sx={{
backgroundColor: theme.palette.primary.light,
color: theme.palette.text.primary,
fontFamily: "Raleway", fontFamily: "Raleway",
}} }}
> >
Close Close
</Button> </ThemeButtonBright>
</ModalContent> </ModalContent>
</StyledModal> </StyledModal>
); );

View File

@ -10,12 +10,14 @@ export const AddCoverImageButton = styled(Button)(({ theme }) => ({
fontSize: "16px", fontSize: "16px",
fontWeight: 400, fontWeight: 400,
letterSpacing: "0.2px", letterSpacing: "0.2px",
color: "white", color: theme.palette.text.primary,
backgroundColor: "#44c4ff",
"&:hover": { backgroundColor: "#01a9e9" },
gap: "5px", gap: "5px",
})); }));
export const AddLogoIcon = styled(AddPhotoAlternateIcon)(({ theme }) => ({ export const AddLogoIcon = styled(AddPhotoAlternateIcon)(({ theme }) => ({
color: "#fff", color: theme.palette.text.primary,
height: "25px", height: "25px",
width: "auto", width: "auto",
})); }));

View File

@ -5,8 +5,10 @@ import { BlockedNamesModal } from "../../common/BlockedNamesModal/BlockedNamesMo
import { import {
AvatarContainer, AvatarContainer,
CustomAppBar, CustomAppBar,
DarkModeIcon,
DropdownContainer, DropdownContainer,
DropdownText, DropdownText,
LightModeIcon,
LogoContainer, LogoContainer,
NavbarName, NavbarName,
ThemeSelectRow, ThemeSelectRow,
@ -236,6 +238,21 @@ const NavBar: React.FC<Props> = ({
</Popover> </Popover>
<DownloadTaskManager /> <DownloadTaskManager />
{theme.palette.mode === "dark" ? (
<LightModeIcon
onClickFunc={() => setTheme("light")}
color="white"
height="22"
width="22"
/>
) : (
<DarkModeIcon
onClickFunc={() => setTheme("dark")}
color="black"
height="22"
width="22"
/>
)}
{isAuthenticated && userName && ( {isAuthenticated && userName && (
<> <>
<AvatarContainer <AvatarContainer

View File

@ -1,19 +1,18 @@
import { styled } from "@mui/system"; import { styled } from "@mui/system";
import { Box, Grid, Typography, Checkbox } from "@mui/material"; import { Box, Button, Grid, Typography } from "@mui/material";
export const SubtitleContainer = styled(Box)(({ theme }) => ({ export const SubtitleContainer = styled(Box)(({ theme }) => ({
display: "flex", display: "flex",
flexDirection: "row", flexDirection: "row",
justifyContent: "center", justifyContent: "center",
alignItems: 'center', alignItems: "center",
margin: '10px 0px', margin: "10px 0px",
width: '100%' width: "100%",
})); }));
export const Subtitle = styled(Typography)(({ theme }) => ({ export const Subtitle = styled(Typography)(({ theme }) => ({
textAlign: 'center', textAlign: "center",
fontSize: '20px' fontSize: "20px",
})); }));
const DoubleLine = styled(Typography)` const DoubleLine = styled(Typography)`
@ -21,15 +20,15 @@ const DoubleLine = styled(Typography)`
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
overflow: hidden; overflow: hidden;
` `;
export const ChannelTitle = styled(DoubleLine)(({ theme }) => ({ export const ChannelTitle = styled(DoubleLine)(({ theme }) => ({
fontFamily: "Cairo", fontFamily: "Cairo",
fontSize: "20px", fontSize: "20px",
letterSpacing: "0.4px", letterSpacing: "0.4px",
color: theme.palette.text.primary, color: theme.palette.text.primary,
userSelect: "none", userSelect: "none",
marginBottom: 'auto', marginBottom: "auto",
textAlign: 'center' textAlign: "center",
})); }));
export const WelcomeTitle = styled(DoubleLine)(({ theme }) => ({ export const WelcomeTitle = styled(DoubleLine)(({ theme }) => ({
fontFamily: "Cairo", fontFamily: "Cairo",
@ -37,33 +36,32 @@ export const WelcomeTitle = styled(DoubleLine)(({ theme }) => ({
letterSpacing: "0.4px", letterSpacing: "0.4px",
color: theme.palette.text.primary, color: theme.palette.text.primary,
userSelect: "none", userSelect: "none",
textAlign: 'center' textAlign: "center",
})); }));
export const WelcomeContainer = styled(Box)(({ theme }) => ({ export const WelcomeContainer = styled(Box)(({ theme }) => ({
position: 'fixed', position: "fixed",
width: '90%', width: "90%",
height: '90%', height: "90%",
backgroundColor: theme.palette.background.paper, backgroundColor: theme.palette.background.paper,
left: '50%', left: "50%",
top: '50%', top: "50%",
transform: 'translate(-50%, -50%)', transform: "translate(-50%, -50%)",
zIndex: 500, zIndex: 500,
display: 'flex', display: "flex",
flexDirection: 'column', flexDirection: "column",
alignItems: 'center', alignItems: "center",
justifyContent: 'center' justifyContent: "center",
})); }));
export const ChannelCard = styled(Grid)(({ theme }) => ({ export const ChannelCard = styled(Grid)(({ theme }) => ({
position: "relative", position: "relative",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
alignItems: 'center', alignItems: "center",
height: "auto", height: "auto",
width: '300px', width: "300px",
minHeight: '130px', minHeight: "130px",
backgroundColor: theme.palette.background.paper, backgroundColor: theme.palette.background.paper,
borderRadius: "8px", borderRadius: "8px",
padding: "10px 15px", padding: "10px 15px",
@ -82,6 +80,20 @@ export const ChannelCard = styled(Grid)(({ theme }) => ({
boxShadow: boxShadow:
theme.palette.mode === "dark" theme.palette.mode === "dark"
? "0px 8px 10px 1px hsla(0,0%,0%,0.14), 0px 3px 14px 2px hsla(0,0%,0%,0.12), 0px 5px 5px -3px hsla(0,0%,0%,0.2)" ? "0px 8px 10px 1px hsla(0,0%,0%,0.14), 0px 3px 14px 2px hsla(0,0%,0%,0.12), 0px 5px 5px -3px hsla(0,0%,0%,0.2)"
: "rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;" : "rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;",
} },
})); }));
export const ThemeButton = styled(Button)(({ theme }) => ({
color: theme.palette.text.primary,
backgroundColor: "#01a9e9",
fontSize: "18px",
"&:hover": { backgroundColor: "#3e74c1" },
}));
export const ThemeButtonBright = styled(Button)(({ theme }) => ({
color: theme.palette.text.primary,
backgroundColor: "#44c4ff",
fontSize: "18px",
"&:hover": { backgroundColor: "#01a9e9" },
}));

View File

@ -3,11 +3,11 @@ import ReactDOM from "react-dom";
import { useDispatch, useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
import { RootState } from "../../state/store"; import { RootState } from "../../state/store";
import { IssueList } from "./IssueList.tsx"; import { IssueList } from "./IssueList.tsx";
import { Box, Button, Grid, Input, useTheme } from "@mui/material"; import { Box, Grid, Input, useTheme } from "@mui/material";
import { useFetchFiles } from "../../hooks/useFetchFiles.tsx"; import { useFetchFiles } from "../../hooks/useFetchFiles.tsx";
import LazyLoad from "../../components/common/LazyLoad"; import LazyLoad from "../../components/common/LazyLoad";
import { FiltersCol, FiltersContainer } from "./IssueList-styles.tsx"; import { FiltersCol, FiltersContainer } from "./IssueList-styles.tsx";
import { SubtitleContainer } from "./Home-styles"; import { SubtitleContainer, ThemeButton } from "./Home-styles";
import { import {
changefilterName, changefilterName,
changefilterSearch, changefilterSearch,
@ -219,7 +219,8 @@ export const Home = ({ mode }: HomeProps) => {
value={filterSearch} value={filterSearch}
placeholder="Search" placeholder="Search"
sx={{ sx={{
borderBottom: "1px solid white", color: theme.palette.text.primary,
borderBottom: `1px solid ${theme.palette.text.primary}`,
"&&:before": { "&&:before": {
borderBottom: "none", borderBottom: "none",
}, },
@ -235,7 +236,7 @@ export const Home = ({ mode }: HomeProps) => {
"&&.Mui-focused": { "&&.Mui-focused": {
outline: "none", outline: "none",
}, },
fontSize: "18px", fontSize: "20px",
}} }}
/> />
<Input <Input
@ -248,7 +249,7 @@ export const Home = ({ mode }: HomeProps) => {
placeholder="User's Name (Exact)" placeholder="User's Name (Exact)"
sx={{ sx={{
marginTop: "20px", marginTop: "20px",
borderBottom: "1px solid white", borderBottom: `1px solid ${theme.palette.text.primary}`,
"&&:before": { "&&:before": {
borderBottom: "none", borderBottom: "none",
}, },
@ -264,37 +265,35 @@ export const Home = ({ mode }: HomeProps) => {
"&&.Mui-focused": { "&&.Mui-focused": {
outline: "none", outline: "none",
}, },
fontSize: "18px", fontSize: "20px",
}} }}
/> />
<CategoryList categoryData={allCategoryData} ref={categoryListRef} /> <CategoryList categoryData={allCategoryData} ref={categoryListRef} />
<Button <ThemeButton
onClick={() => { onClick={() => {
filtersToDefault(); filtersToDefault();
}} }}
sx={{ sx={{
marginTop: "20px", marginTop: "20px",
fontWeight: 1000, fontWeight: 1000,
color: "white",
}} }}
variant="contained" variant="contained"
> >
reset reset
</Button> </ThemeButton>
<Button <ThemeButton
onClick={() => { onClick={() => {
getFilesHandler(true); getFilesHandler(true);
}} }}
sx={{ sx={{
marginTop: "20px", marginTop: "20px",
fontWeight: 1000, fontWeight: 1000,
color: "white",
}} }}
variant="contained" variant="contained"
> >
Search Search
</Button> </ThemeButton>
</FiltersContainer> </FiltersContainer>
</FiltersCol> </FiltersCol>
<Grid item xs={12} md={10} sm={9}> <Grid item xs={12} md={10} sm={9}>

View File

@ -90,9 +90,9 @@ const lightTheme = createTheme({
palette: { palette: {
mode: "light", mode: "light",
primary: { primary: {
main: "#ffffff", main: "#FCFCFC",
dark: "#F5F5F5", dark: "#F5F5F5",
light: "#FCFCFC", light: "#FFFFFF",
}, },
secondary: { secondary: {
main: "#417Ed4", main: "#417Ed4",