refactor(nui): Styling and sizing changes

This commit is contained in:
Luke committed 2022-03-20 19:58:52 +01:00
1 parent 5a556f3764
commit 3148ef6b1f
6 files changed
+27 -8

No files matched your search

+8 -3
View File
@@ -12,6 +12,7 @@ import { fetchNui } from "../utils/fetchNui";
interface Props {
duration: number;
position?: "middle" | "bottom";
percent?: boolean;
}
debugData([
@@ -74,9 +75,11 @@ const CircleProgressbar: React.FC = () => {
<ScaleFade in={visible} unmountOnExit>
<CircularProgress
value={value}
size="7rem"
size="5rem"
trackColor="rgba(0, 0, 0, 0.6)"
onAnimationEnd={progressComplete}
color={cancelled ? "rgb(198, 40, 40)" : "blue.400"}
thickness={6}
color={cancelled ? "rgb(198, 40, 40)" : "white"}
sx={
!cancelled
? {
@@ -95,7 +98,9 @@ const CircleProgressbar: React.FC = () => {
}
}
>
<CircularProgressLabel color="black">{value}%</CircularProgressLabel>
<CircularProgressLabel fontFamily="Fira Mono">
{value}%
</CircularProgressLabel>
</CircularProgress>
</ScaleFade>
</Flex>
+6 -1
View File
@@ -67,8 +67,10 @@ const Progressbar: React.FC = () => {
<Progress
value={100}
height="2.8rem"
borderRadius="sm"
fontFamily="Inter"
flex="1 1 auto"
boxShadow="lg"
onAnimationEnd={progressComplete}
sx={
!cancelled
@@ -76,6 +78,7 @@ const Progressbar: React.FC = () => {
// really scuffed solution but works, wonder if there's a better way to do this?
"> div:first-of-type": {
animation: `progress-bar linear ${duration}ms`,
borderRadius: "none",
},
}
: {
@@ -86,7 +89,9 @@ const Progressbar: React.FC = () => {
}
}
>
<ProgressLabel fontSize={20}>{label}</ProgressLabel>
<ProgressLabel fontSize={22} fontWeight="light">
{label}
</ProgressLabel>
</Progress>
</ScaleFade>
</Box>
+8 -1
View File
@@ -48,7 +48,14 @@ const TextUI: React.FC = () => {
}
>
<ScaleFade in={visible} unmountOnExit>
<Box bg="blue.400" p={3} fontFamily="Poppins" style={data.style}>
<Box
bg="gray.700"
boxShadow="lg"
p={3}
fontFamily="Poppins"
style={data.style}
borderRadius="md"
>
<Text>{data.text}</Text>
</Box>
</ScaleFade>