Skip to content

Commit

Permalink
fix: improv layout & centering in Time widget(#59)
Browse files Browse the repository at this point in the history
The layout and centering in the Time widget have been improved. The time
display is now centered horizontally, and the greeting text is also
centered. This ensures a more visually balanced and appealing
presentation. These changes enhance the user experience by providing a
more aesthetically pleasing display of time and greetings. Fixes #59
  • Loading branch information
Code-Victor committed Nov 22, 2023
1 parent e271356 commit 7c6858e
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/components/inc/widgets/Time.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Time = () => {
state.showTime,
state.showGreeting,
],
shallow
shallow,
);
const timeDate = new Date(time);
useEffect(() => {
Expand Down Expand Up @@ -61,7 +61,12 @@ const Time = () => {
}}
>
{showTime && (
<Box css={{}}>
<Box
css={{
mx: "auto",
width: "min-content",
}}
>
<Box
css={{
position: "relative",
Expand All @@ -70,8 +75,10 @@ const Time = () => {
<Text
as="h1"
fs="6xl"
// ta="center"
css={{
fontWeight: 700,
width: "min-content",
}}
>
{timeString}
Expand Down Expand Up @@ -104,7 +111,11 @@ const Time = () => {
</Box>
)}
{showGreeting && (
<Text fs="2xl" ta="center" css={{ mt: "$2", fontWeight: 600 }}>
<Text
fs="2xl"
ta="center"
css={{ mt: "$2", fontWeight: 600, maxWidth: 480, mx: "auto" }}
>
Good {getDaySegment(timeDate)}, {name}
</Text>
)}
Expand Down

0 comments on commit 7c6858e

Please sign in to comment.