Skip to content
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

🎨 Style: Update Colors and Typography #154

Merged
merged 70 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
19b4a3f
feat(web): create styled-components theme
tyler-dane Oct 19, 2024
b5986cc
style(web): update login page colors
tyler-dane Oct 19, 2024
ec0cdc6
style(web): update login card box-shadow on hover
tyler-dane Oct 20, 2024
ccb33c9
style: remove TodayButton border
tyler-dane Oct 20, 2024
fb4c305
style: update Calendar background color
tyler-dane Oct 20, 2024
1aafcff
style: Dedication
tyler-dane Oct 20, 2024
1fd71cb
style: bg color
tyler-dane Oct 20, 2024
ce9fb84
style: Logout page
tyler-dane Oct 20, 2024
a6aeb24
test(web): add ThemeProvider to custom RTL render
tyler-dane Oct 20, 2024
62c25af
style: left sidebar
tyler-dane Oct 20, 2024
06eeb81
style: scrollbar in left sidebar
tyler-dane Oct 20, 2024
a2f8d0c
style: divider in left sidebar
tyler-dane Oct 20, 2024
0e9d794
style: sidebar heading text
tyler-dane Oct 20, 2024
072006a
style: tooltip
tyler-dane Oct 22, 2024
476ff01
style: linear gradient, hover colors
tyler-dane Oct 22, 2024
37dbb89
style: Button border
tyler-dane Oct 22, 2024
4f628dd
style: Button border & input
tyler-dane Oct 22, 2024
e5425ed
style: TimePicker
tyler-dane Oct 22, 2024
1c75d74
style: SomedayEventForm - Repeat Section
tyler-dane Oct 22, 2024
a11e01f
chore(web): remove 2+3 week recurrences & fix typing
tyler-dane Oct 23, 2024
db81b6e
deps(web): install tinycolor2
tyler-dane Oct 23, 2024
2b39528
style: RepeatDialog
tyler-dane Oct 23, 2024
cc8688f
style: SaveSection
tyler-dane Oct 23, 2024
4511790
deps: move tinycolor to @core
tyler-dane Oct 23, 2024
0c12dbc
refactor: use brighten() in RepeatDialog
tyler-dane Oct 23, 2024
c9b904d
style: SomedayEventForm: box shadow
tyler-dane Oct 24, 2024
c603389
style: Priority Buttons
tyler-dane Oct 25, 2024
8212bcf
refactor: rename text styles to light/dark
tyler-dane Oct 25, 2024
1886e8e
style: NewSomedayEvent
tyler-dane Oct 26, 2024
d9ab563
style: SaveSection (EventForm)
tyler-dane Oct 26, 2024
efe6f03
style: use theme's animation
tyler-dane Oct 26, 2024
0ed1043
style: Textarea
tyler-dane Oct 29, 2024
4c3f352
style: Text
tyler-dane Oct 29, 2024
ec3da6b
style: LeftSidebar
tyler-dane Oct 29, 2024
738f892
style: add text placeholder color
tyler-dane Oct 29, 2024
c1a122b
style: Event
tyler-dane Oct 29, 2024
03eed15
fix: GridEvent memo
tyler-dane Oct 30, 2024
2a5b440
style: DatePicker Input
tyler-dane Oct 30, 2024
0e5dfac
style: DatePicker
tyler-dane Oct 30, 2024
a76ef0b
style: Event drop-shadow
tyler-dane Oct 30, 2024
a9ee6af
style: add margin to form Description
tyler-dane Oct 30, 2024
8a21099
refactor: extract DayLabels from Header
tyler-dane Oct 31, 2024
495614f
style: DayLabels
tyler-dane Oct 31, 2024
d67bac3
refactor: separate theme from theme utils
tyler-dane Nov 1, 2024
b70e899
style: TextField gradient underline
tyler-dane Nov 1, 2024
95f26c9
style: set default gradient to gray
tyler-dane Nov 4, 2024
c8a5f2d
style: RightSidebar
tyler-dane Nov 4, 2024
8237ca9
style: GridEventPreview
tyler-dane Nov 4, 2024
42f02d8
style: hour labels
tyler-dane Nov 4, 2024
6e5582c
style: ArrowLineLeftIcon
tyler-dane Nov 4, 2024
f4fdd16
style: lined arrow icons
tyler-dane Nov 4, 2024
72b7d93
style: Command
tyler-dane Nov 4, 2024
14c914c
style: List
tyler-dane Nov 4, 2024
a6b64a0
style: TimePicker
tyler-dane Nov 5, 2024
c9284bf
style: grid lines
tyler-dane Nov 5, 2024
544e040
style: scrollbar
tyler-dane Nov 5, 2024
a608585
style: MontWidget
tyler-dane Nov 5, 2024
aa7d8f0
style: Login, CmdPalette
tyler-dane Nov 5, 2024
aa7e7ba
chore: remove getColor and getInvertedColor utils
tyler-dane Nov 5, 2024
0869874
chore: remove getNeighbourKey util
tyler-dane Nov 5, 2024
6f92d9d
style: NotFound
tyler-dane Nov 5, 2024
f239493
chore(backend): remove color from priority schema
tyler-dane Nov 6, 2024
92ffb85
chore: delete colors.ts and color.types.ts
tyler-dane Nov 6, 2024
cd4b7c1
feat: update colors
tyler-dane Nov 8, 2024
ca6f681
feat: change font-family to Rubik
tyler-dane Nov 10, 2024
6304596
feat: update font sizes
tyler-dane Nov 10, 2024
1fcb690
feat: add font weight and size to theme
tyler-dane Nov 11, 2024
74d5a23
chore: cleanup font size type
tyler-dane Nov 11, 2024
ddd9bba
style: Timepicker font size
tyler-dane Nov 11, 2024
3e777e6
chore: cleanup DayLabel import
tyler-dane Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions packages/backend/src/priority/services/priority.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
import { Priorities } from "@core/constants/core.constants";
import { Status } from "@core/errors/status.codes";
import { BaseError } from "@core/errors/errors.base";
import { colorNameByPriority } from "@core/constants/colors";
import { Collections } from "@backend/common/constants/collections";
import mongoService from "@backend/common/services/mongo.service";

Expand Down Expand Up @@ -62,7 +61,6 @@ class PriorityService {
_id: response.insertedId.toString(),
user: userId,
name: data.name,
color: data.color,
};

return priority;
Expand All @@ -72,22 +70,18 @@ class PriorityService {
async createDefaultPriorities(userId: string) {
return await this.create(userId, [
{
color: colorNameByPriority.unassigned,
name: Priorities.UNASSIGNED,
user: userId,
},
{
color: colorNameByPriority.self,
name: Priorities.SELF,
user: userId,
},
{
color: colorNameByPriority.work,
name: Priorities.WORK,
user: userId,
},
{
color: colorNameByPriority.relationships,
name: Priorities.RELATIONS,
user: userId,
},
Expand Down
2 changes: 2 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
"lint-fix": "exit"
},
"devDependencies": {
"@types/tinycolor2": "^1.4.6",
"typescript": "^5.1.6"
},
"dependencies": {
"tinycolor2": "^1.6.0",
"winston": "^3.8.1"
}
}
69 changes: 0 additions & 69 deletions packages/core/src/constants/colors.ts

This file was deleted.

49 changes: 0 additions & 49 deletions packages/core/src/types/color.types.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/core/src/types/priority.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export interface PriorityReq {
color: string;
name: string;
}

Expand Down
53 changes: 5 additions & 48 deletions packages/core/src/util/color.utils.ts
Original file line number Diff line number Diff line change
@@ -1,52 +1,9 @@
import { Priorities } from "@core/constants/core.constants";
import { ColorHex, colors, invertedColors } from "@core/constants/colors";
import { ColorNames, InvertedColorNames } from "@core/types/color.types";
import tinycolor from "tinycolor2";

export const getAlphaColor = (colorName: ColorNames, opacity: number) => {
const _opacity = Math.round(Math.min(Math.max(opacity || 1, 0), 1) * 255);
return getColor(colorName) + _opacity.toString(16).toUpperCase();
export const brighten = (color: string, amount?: number) => {
return tinycolor(color).brighten(amount).toString();
};

export const getBrighterColor = (colorName: ColorNames) => {
// assumes that the higher the numbers are, the brighter the colors
//@ts-ignore
return colors[getNeighbourKey(colorName, colors, 1)] as string;
};

export const getColor = (colorName: ColorNames) =>
colors[colorName] as ColorHex;

export const getDarkerColor = (colorName: ColorNames) => {
return colors[getNeighbourKey(colorName, colors, -1) as ColorNames];
};

export const getInvertedColor = (colorName: InvertedColorNames) => {
//@ts-ignore
return invertedColors[colorName] as string;
};

export const getNeighbourKey = (key = "", obj = {}, diff = 1) => {
const splitKeys = key.split("_");
if (splitKeys === undefined || splitKeys.length < 1) {
throw new Error(
'You should provide object with keys "ANYTHING_KEY_NUMBER" where NUMBER is number'
);
}

const prev = splitKeys.length - 1;
//@ts-ignore
const index = +splitKeys[prev];
const propName = splitKeys.filter((value) => value !== `${index}`).join("_");

const neighbourIndex = index + diff;
const neighbourKey = `${propName}_${neighbourIndex}`;

return Object.keys(obj).find((_key) => _key === neighbourKey) || key;
};

export const hoverColorsByPriority = {
[Priorities.UNASSIGNED]: "#F0FFFF",
[Priorities.WORK]: "#80B8E1",
[Priorities.RELATIONS]: "#86D2ED",
[Priorities.SELF]: "#8EB1FF",
export const darken = (color: string, amount?: number) => {
return tinycolor(color).darken(amount).toString();
};
37 changes: 20 additions & 17 deletions packages/web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import React from "react";
import { SuperTokensWrapper } from "supertokens-auth-react";
import { ToastContainer } from "react-toastify";
import { ThemeProvider } from "styled-components";
import SuperTokens, { SuperTokensWrapper } from "supertokens-auth-react";
import Session from "supertokens-auth-react/recipe/session";
import { Provider } from "react-redux";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
import { GoogleOAuthProvider } from "@react-oauth/google";
import Session from "supertokens-auth-react/recipe/session";
import SuperTokens from "supertokens-auth-react";
import { APP_NAME, PORT_DEFAULT_WEB } from "@core/constants/core.constants";
import { ROOT_ROUTES } from "@web/common/constants/routes";
import { sagaMiddleware } from "@web/common/store/middlewares";
import { sagas } from "@web/store/sagas";
import { GlobalStyle } from "@web/components/GlobalStyle";
import { ENV_WEB } from "@web/common/constants/env.constants";
import { ToastContainer } from "react-toastify";

import { RootRouter } from "./routers";
import { store } from "./store";
import { theme } from "./common/styles/theme";

SuperTokens.init({
appInfo: {
Expand All @@ -38,19 +39,21 @@ export const App = () => {
<GoogleOAuthProvider clientId={ENV_WEB.CLIENT_ID}>
<SuperTokensWrapper>
<GlobalStyle />
<RootRouter />
<ToastContainer
position="bottom-left"
autoClose={5000}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover
theme="dark"
/>
<ThemeProvider theme={theme}>
<RootRouter />
<ToastContainer
position="bottom-left"
autoClose={5000}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover
theme="dark"
/>
</ThemeProvider>
</SuperTokensWrapper>
</GoogleOAuthProvider>
</Provider>
Expand Down
10 changes: 7 additions & 3 deletions packages/web/src/__tests__/__mocks__/mock.render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { render, RenderOptions } from "@testing-library/react";
import { sagas } from "@web/store/sagas";
import { sagaMiddleware } from "@web/common/store/middlewares";
import { reducers } from "@web/store/reducers";
import { ThemeProvider } from "styled-components";
import { theme } from "@web/common/styles/theme";

const customRender = (
ui: ReactElement,
Expand All @@ -30,9 +32,11 @@ const customRender = (
return (
<DndProvider backend={HTML5Backend}>
<GoogleOAuthProvider clientId="anyClientId">
<BrowserRouter>
<Provider store={store}>{children}</Provider>
</BrowserRouter>
<ThemeProvider theme={theme}>
<BrowserRouter>
<Provider store={store}>{children}</Provider>
</BrowserRouter>
</ThemeProvider>
</GoogleOAuthProvider>
</DndProvider>
);
Expand Down
11 changes: 0 additions & 11 deletions packages/web/src/__tests__/utils/color.utils.test.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/web/src/common/constants/web.constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Recurrence_Selection } from "../types/web.event.types";

export const ANIMATION_TIME_3_MS = "0.3s";

export const COLUMN_WEEK = "weekEvents";
export const COLUMN_MONTH = "monthEvents";

Expand Down
21 changes: 0 additions & 21 deletions packages/web/src/common/styles/components.ts

This file was deleted.

Loading