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

feat: templates framework #4254

Open
wants to merge 177 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 167 commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
fbecc14
add basic route and component
Schwehn42 Jun 18, 2024
f725469
add index redirect
Schwehn42 Jun 18, 2024
21366a3
moves files for the time being
Schwehn42 Jun 18, 2024
394edc2
quick flex layout
Schwehn42 Jun 18, 2024
9a95041
create UserPill component
Schwehn42 Jun 18, 2024
fa39589
add own name
Schwehn42 Jun 18, 2024
70a87a4
style user pill
Schwehn42 Jun 18, 2024
323846a
add provisional background
Schwehn42 Jun 18, 2024
f5017c2
title
Schwehn42 Jun 18, 2024
757f601
add className prop to UserPill
Schwehn42 Jun 18, 2024
9ade835
align using grid
Schwehn42 Jun 18, 2024
5e621b0
change template cols
Schwehn42 Jun 18, 2024
25c0bf5
add user pill pseudo classes
Schwehn42 Jun 19, 2024
6f7e626
add simple switch
Schwehn42 Jun 19, 2024
5646995
rename to switch
Schwehn42 Jun 19, 2024
8ab3d50
switch type refactor
Schwehn42 Jun 19, 2024
bc52a63
style switch
Schwehn42 Jun 19, 2024
7ccfef4
switch functionality
Schwehn42 Jun 19, 2024
0345ae0
switch class names
Schwehn42 Jun 19, 2024
58cf0db
forgot to add switch padding and border radius
Schwehn42 Jun 19, 2024
3d1ef59
initialize switch
Schwehn42 Jun 19, 2024
1bc5cbe
make init func optional
Schwehn42 Jun 20, 2024
08a59a1
switch function may also be optional
Schwehn42 Jun 20, 2024
1467158
add optional classNames
Schwehn42 Jun 20, 2024
e82d3e5
new grid just dropped
Schwehn42 Jun 20, 2024
d2e6c1f
add search bar component
Schwehn42 Jun 20, 2024
46627d5
switch: align text
Schwehn42 Jun 20, 2024
5ef619c
search bar first styling
Schwehn42 Jun 20, 2024
e2433e4
revert templates component to a clean state
Schwehn42 Jun 20, 2024
e1f90c9
add outlet to grid
Schwehn42 Jun 20, 2024
633d7cf
add and align template containers
Schwehn42 Jun 20, 2024
5914db0
container titles
Schwehn42 Jun 20, 2024
000e9e2
trying to get the background right
Schwehn42 Jun 20, 2024
41489c9
grid row distances
Schwehn42 Jun 20, 2024
2c15fbb
add stan picture
Schwehn42 Jun 20, 2024
9c209e8
add stan to templates
Schwehn42 Jun 20, 2024
07a65e7
add some spacing to the board
Schwehn42 Jun 20, 2024
4ef35f3
add word wrap
Schwehn42 Jun 20, 2024
fb87a57
fix missing container gap space
Schwehn42 Jun 20, 2024
db13c83
adjust stan transformation
Schwehn42 Jun 20, 2024
cbd497e
nevermind, all of this isn't needed
Schwehn42 Jun 20, 2024
c6849f8
make switch stateless
Schwehn42 Jun 20, 2024
b8de83e
localization
Schwehn42 Jun 20, 2024
77263d6
SearchBar also gets localized
Schwehn42 Jun 20, 2024
49c5f17
add comment for later
Schwehn42 Jun 21, 2024
455b7f4
add mixins for default states
Schwehn42 Jun 21, 2024
81bba74
apply default states to search bar, user pill and switch
Schwehn42 Jun 21, 2024
defcca8
fix: forgot variable change
Schwehn42 Jun 21, 2024
9969a5a
variable rename
Schwehn42 Jun 21, 2024
4db924d
more input style
Schwehn42 Jun 21, 2024
c03ec4f
search bar hover style
Schwehn42 Jun 21, 2024
4327d01
search bar disabled state
Schwehn42 Jun 21, 2024
319b423
add disabled state to switch
Schwehn42 Jun 21, 2024
ba9a8e2
fix switch padding
Schwehn42 Jun 21, 2024
4bffc33
fix switch active font weight
Schwehn42 Jun 21, 2024
78ed5ac
fix switch user select and cursor
Schwehn42 Jun 21, 2024
b7069ad
change user pill to button
Schwehn42 Jun 21, 2024
0b4df66
add disabled state to UserPill
Schwehn42 Jun 21, 2024
55afc60
try different padding
Schwehn42 Jun 21, 2024
c0a8c0a
make linter happy
Schwehn42 Jun 21, 2024
df47e1b
Merge branch 'main' into js/template-sessions-framework
Lennart01 Jun 21, 2024
a0fa5fb
mobile grid templates v1
Schwehn42 Jun 22, 2024
5a0841b
UserPill mobile
Schwehn42 Jun 22, 2024
e1450af
mobile search bar initial alignment
Schwehn42 Jun 22, 2024
e0dada5
hide search button in desktop view
Schwehn42 Jun 22, 2024
fa0cd01
search button colors
Schwehn42 Jun 22, 2024
15a0f6b
search button toggle
Schwehn42 Jun 22, 2024
0391fe7
add close icon
Schwehn42 Jun 22, 2024
b78feed
adjust classes and styles
Schwehn42 Jun 22, 2024
05b826b
icon cursor
Schwehn42 Jun 22, 2024
9f290da
only show close icon if prop is set
Schwehn42 Jun 22, 2024
8aa2cae
search bar close function
Schwehn42 Jun 22, 2024
0ebdaa3
rename logo -> icon
Schwehn42 Jun 22, 2024
312ff11
change active button color
Schwehn42 Jun 22, 2024
1f3a019
class typo
Schwehn42 Jun 22, 2024
fb65d88
place containers next to each other
Schwehn42 Jun 22, 2024
c87ca9e
search bar tabbable
Schwehn42 Jun 22, 2024
bc9227b
mixin border on focus-within
Schwehn42 Jun 22, 2024
76497e3
change switch toggle function
Schwehn42 Jun 23, 2024
57306ba
switch pointer not only on active side
Schwehn42 Jun 23, 2024
4ac6cfa
provisional settings routes
Schwehn42 Jun 23, 2024
eca3148
add settings outlets
Schwehn42 Jun 23, 2024
a3841f2
UserPill navigate to settings
Schwehn42 Jun 23, 2024
391035f
render custom avatar if available
Schwehn42 Jun 27, 2024
78a5024
proper title sizes
Schwehn42 Jun 27, 2024
d111873
dont forget to adjust grid size, too
Schwehn42 Jun 27, 2024
c0ec84a
switch mobile layout
Schwehn42 Jun 27, 2024
811d236
searchbar mobile layout
Schwehn42 Jun 27, 2024
0c7e23a
userpill mobile size fix
Schwehn42 Jun 27, 2024
7bb6ad5
mobile paddings and margins and the borders
Schwehn42 Jun 27, 2024
1e3b987
add gap rows
Schwehn42 Jun 27, 2024
b10bc9e
gap col
Schwehn42 Jun 27, 2024
e5d38e7
separate header and outlet
Schwehn42 Jun 27, 2024
bdd40d5
move padding to header
Schwehn42 Jun 27, 2024
d01f4ae
provisional outlet padding
Schwehn42 Jun 27, 2024
7322938
Merge branch 'refs/heads/js/templates-and-sessions' into js/template-…
Schwehn42 Jun 27, 2024
c1f0047
display saved templates for non-anon users only
Schwehn42 Jun 27, 2024
c0e73f3
Revert "provisional outlet padding"
Schwehn42 Jun 28, 2024
f44dc6d
Revert "move padding to header"
Schwehn42 Jun 28, 2024
f0585de
Revert "separate header and outlet"
Schwehn42 Jun 28, 2024
d218568
use correct container for header logo; class renames
Schwehn42 Jun 28, 2024
2a18a53
add padding rows/cols for desktop
Schwehn42 Jun 28, 2024
a891754
mobile grid: padding rows/cols, main full width
Schwehn42 Jun 28, 2024
c143823
comment
Schwehn42 Jun 28, 2024
f953695
percent to vh
Schwehn42 Jun 28, 2024
1eae69f
renderConotainerHeader function
Schwehn42 Jun 28, 2024
e83adb9
add arrows
Schwehn42 Jun 28, 2024
a431172
title sizes and line heights
Schwehn42 Jun 28, 2024
03a2f06
icons size and alignment
Schwehn42 Jun 28, 2024
3149beb
show arrows on in mobile view
Schwehn42 Jun 28, 2024
05f3b9a
disable arrow color
Schwehn42 Jun 28, 2024
e261482
add buttons
Schwehn42 Jun 28, 2024
500d8d3
naive scroll impl
Schwehn42 Jun 28, 2024
2f1c22d
dark mode: templates
Schwehn42 Jun 28, 2024
a6e36d9
dark theme: new board title and search button icon
Schwehn42 Jun 28, 2024
f90e0f8
search bar dark mode
Schwehn42 Jun 28, 2024
369698d
search bar dark mode part 2 incl disabled states
Schwehn42 Jun 28, 2024
b5fbcbc
template dark arrow colors
Schwehn42 Jun 28, 2024
2422db9
switch dark mode
Schwehn42 Jun 28, 2024
be8f576
switch dark disable style
Schwehn42 Jun 28, 2024
ffc798d
user pill dark theme
Schwehn42 Jun 28, 2024
7e3f860
user pill dark disabled style
Schwehn42 Jun 28, 2024
43cf4a8
bottom row
Schwehn42 Jun 28, 2024
ed5787b
default state dark theme
Schwehn42 Jun 28, 2024
29c8ee4
only show arrows if logged in
Schwehn42 Jun 28, 2024
ee0a57f
clickable title
Schwehn42 Jun 28, 2024
25ff89a
div -> section
Schwehn42 Jun 28, 2024
4b4f11e
remove accidental parentheses
Schwehn42 Jun 28, 2024
9379996
dark background
Schwehn42 Jun 29, 2024
bafb0f7
adjust side padding for desktop
Schwehn42 Jun 29, 2024
7604563
adjust stan height factor
Schwehn42 Jun 29, 2024
f91a24f
Merge branch 'refs/heads/js/templates-and-sessions' into js/template-…
Schwehn42 Jul 11, 2024
9803b89
use new color palette
Schwehn42 Jul 11, 2024
a9d6c40
rename NewBoard -> Boards
Schwehn42 Jul 11, 2024
41f6adc
rename class names
Schwehn42 Jul 11, 2024
8117682
change route
Schwehn42 Jul 11, 2024
3f3e51e
Merge branch 'refs/heads/main' into js/template-sessions-framework
Schwehn42 Jul 12, 2024
92c8bed
Merge branch 'refs/heads/js/templates-and-sessions' into js/template-…
Schwehn42 Jul 18, 2024
43eef4d
move blue--50 to color file
Schwehn42 Jul 18, 2024
e5c9135
adjust scrumlr logo
Schwehn42 Jul 18, 2024
fb808e9
switch recommended <-> saved templates
Schwehn42 Jul 18, 2024
d8e40de
Merge branch 'refs/heads/js/templates-and-sessions' into js/template-…
Schwehn42 Jul 22, 2024
d36e36e
Merge branch 'refs/heads/js/templates-and-sessions' into js/template-…
Schwehn42 Jul 24, 2024
73cfa1b
make search bar stateless and clearable
Schwehn42 Jul 24, 2024
fe6af83
more grid space
Schwehn42 Jul 22, 2024
5c79ba6
Merge branch 'refs/heads/js/templates-and-sessions' into js/template-…
Schwehn42 Jul 24, 2024
b17cdad
Merge branch 'refs/heads/js/templates-and-sessions' into js/template-…
Schwehn42 Aug 7, 2024
1f6ad7d
Merge branch 'js/templates-and-sessions' into js/template-sessions-fr…
Schwehn42 Sep 11, 2024
50e4101
legacy create board env
Schwehn42 Sep 23, 2024
d23534f
router legacy create board
Schwehn42 Sep 23, 2024
3d0b61f
(re)add legacy new board
Schwehn42 Sep 23, 2024
3414ce3
del old column templates
Schwehn42 Sep 23, 2024
112b783
update e2e spec
Schwehn42 Sep 23, 2024
b725971
env legacy -> false
Schwehn42 Sep 23, 2024
748bd06
change legacy env var
Schwehn42 Sep 23, 2024
6da8ae4
Merge branch 'main' into js/template-sessions-framework
Schwehn42 Sep 25, 2024
4be3ff5
Merge branch 'main' into js/template-sessions-framework
Schwehn42 Sep 30, 2024
1b07d79
legacy create board view init state in new reducer
Schwehn42 Sep 30, 2024
9dd137c
Merge branch 'main' into js/template-sessions-framework
Schwehn42 Oct 24, 2024
46d1179
update settings dialog enabled menu items
Schwehn42 Oct 24, 2024
77202a0
Merge branch 'main' into js/template-sessions-framework
Schwehn42 Oct 28, 2024
5b2325c
fix: local user setting change (#4584)
Schwehn42 Nov 13, 2024
a0ae6b1
Merge branch 'main' into js/template-sessions-framework
Schwehn42 Nov 13, 2024
1bd5609
translation conflicts
Schwehn42 Nov 13, 2024
3e1dd8e
snapshot
Schwehn42 Nov 13, 2024
6f5945c
Merge branch 'main' into js/template-sessions-framework
Schwehn42 Dec 16, 2024
e8a41e3
fix imports
Schwehn42 Dec 16, 2024
8eddd17
Merge branch 'main' into js/template-sessions-framework
brandstetterm Dec 27, 2024
3c98c3f
review: search bar prop naming
Schwehn42 Jan 10, 2025
e052f38
review: search bar clear button
Schwehn42 Jan 10, 2025
6670952
review: unnecessary tabIndex
Schwehn42 Jan 10, 2025
004bde4
update snapshot
Schwehn42 Jan 10, 2025
4e7f90d
Revert "update snapshot"
Schwehn42 Jan 10, 2025
16249ca
Merge branch 'main' into js/template-sessions-framework
brandstetterm Jan 13, 2025
f3b0491
Merge branch 'main' into js/template-sessions-framework
Schwehn42 Jan 13, 2025
32d590b
Merge branch 'main' into js/template-sessions-framework
Lennart01 Jan 26, 2025
793b31d
Merge branch 'main' into js/template-sessions-framework
Lennart01 Jan 27, 2025
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
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
PUBLIC_URL=/
REACT_APP_PUBLIC_URL=/
REACT_APP_VERSION=$npm_package_version
REACT_APP_VERSION=$npm_package_version

REACT_APP_LEGACY_CREATE_BOARD=true
2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ REACT_APP_VERSION=$npm_package_version
SKIP_PREFLIGHT_CHECK=true
PUBLIC_URL=http://localhost:3000
REACT_APP_PUBLIC_URL=http://localhost:3000

REACT_APP_LEGACY_CREATE_BOARD=false
14 changes: 7 additions & 7 deletions cypress/e2e/landingPageToBoard-spec.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="cypress" />
/// <reference path="../support/index.d.ts" />

import { columnTemplates } from "../../src/routes/NewBoard/columnTemplates"
import { legacyColumnTemplates } from "../../src/routes/Boards/Legacy/legacyColumnTemplates"
import translationEn from "../../src/i18n/en/translation.json"

describe("Navigation from landing page to board", () => {
Expand All @@ -28,31 +28,31 @@ describe("Navigation from landing page to board", () => {
cy.get("button").contains(translationEn.LoginBoard.login).click()

// check templates
cy.get("h1").contains(translationEn.NewBoard.basicConfigurationTitle)
Object.values(columnTemplates).forEach(templateName => {
cy.get("h1").contains(translationEn.LegacyNewBoard.basicConfigurationTitle)
Object.values(legacyColumnTemplates).forEach(templateName => {
cy.contains(templateName.name)
})

cy.get("button")
.contains(translationEn.NewBoard.createNewBoard)
.contains(translationEn.LegacyNewBoard.createNewBoard)
.parent()
.should("be.disabled")

// select template
cy.get("input[type='radio']").siblings().contains("Lean Coffee").click()

cy.get("button")
.contains(translationEn.NewBoard.createNewBoard)
.contains(translationEn.LegacyNewBoard.createNewBoard)
.parent()
.should("not.be.disabled")

// click CTA
cy.get("button")
.contains(translationEn.NewBoard.createNewBoard)
.contains(translationEn.LegacyNewBoard.createNewBoard)
.click()

// navigates to the board
cy.url().should("include", "/board/")
cy.get("h2").contains("Lean Coffee")
})
})
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
142 changes: 142 additions & 0 deletions src/components/SearchBar/SearchBar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
@import "constants/style";

$padding--default: $spacing--base;
$padding--mobile: 12.5px $spacing--base;

.search-bar {
display: flex;
flex-direction: row;
align-items: center;
gap: $spacing--xs;

width: 100%;
padding: $padding--default;
border-radius: $rounded--full;

background-color: $gray--000;

&:not(&--disabled) {
@include default-states($padding: $padding--default);

// alternatively, this could be split up and put in their respective classes,
// which might be more readable but also requires a little bit more code
&:hover,
&:focus-within {
.search-bar__icon-container--search-icon {
color: $navy--600;
}

.search-bar__input {
color: $navy--600;
}
}
}

&--disabled {
background-color: $gray--300;

.search-bar__icon-container {
&--search-icon,
&--clear-icon {
color: $gray--800;
}
}
}
}

.search-bar__icon-container {
width: $icon--large;
height: $icon--large;

&--search-icon {
color: $gray--800;
}

&--clear-icon {
cursor: pointer;
}
}

.search-bar__input {
width: 100%;
padding: 0;
margin: 0;
border: none;

font-size: $text--base;
font-weight: 600;

color: $gray--800;
background-color: $gray--000;

&:focus {
outline: none;

color: $navy--600;
}

&::placeholder {
opacity: 100%;
}

&:disabled {
background-color: $gray--300;
}
}

@media screen and (max-width: $breakpoint--smartphone) {
.search-bar {
padding: $padding--mobile;

&:not(&--disabled) {
@include default-states($padding: $padding--mobile);
}
}
}

[theme="dark"] {
.search-bar {
background-color: $navy--400;

&:not(&--disabled) {
&:hover,
&:focus-within {
.search-bar__icon-container--search-icon {
color: $gray--000;
}

.search-bar__input {
color: $gray--000;
}
}
}

&--disabled {
background-color: $navy--700;

.search-bar__icon-container {
&--search-icon,
&--clear-icon {
color: $navy--300;
}
}
}
}

.search-bar__input {
color: $blue--50;
background-color: $navy--400;

&:disabled {
color: $navy--300;
background-color: $navy--700;
}
}

.search-bar__icon-container {
&--search-icon,
&--clear-icon {
color: $blue--50;
}
}
}
38 changes: 38 additions & 0 deletions src/components/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import {Dispatch, FormEvent, SetStateAction} from "react";
import {useTranslation} from "react-i18next";
import classNames from "classnames";
import {ReactComponent as SearchIcon} from "assets/icons/search.svg";
import {ReactComponent as ClearIcon} from "assets/icons/close.svg";
import "./SearchBar.scss";

type SearchBarProps = {
className?: string;
disabled?: boolean;
input: string;
Schwehn42 marked this conversation as resolved.
Show resolved Hide resolved
setInput: Dispatch<SetStateAction<string>>;
Schwehn42 marked this conversation as resolved.
Show resolved Hide resolved
};

/*
* stateless search bar component.
* if the input is not empty, it's clearable using the X button
*/
export const SearchBar = (props: SearchBarProps) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably use debounce

const {t} = useTranslation();

const updateInput = (e: FormEvent<HTMLInputElement>) => props.setInput(e.currentTarget.value);
const clearInput = () => props.setInput("");

return (
<div className={classNames(props.className, "search-bar", {"search-bar--disabled": props.disabled})}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clicking on the search bar should always focus the input. Right now, the input is only focused if you actually click on the input within the container.

<div className="search-bar__icon-container search-bar__icon-container--search-icon">
<SearchIcon className="search-bar__icon" aria-label="logo of magnifying glass" />
</div>
<input className="search-bar__input" type="text" placeholder={t("SearchBar.placeholder")} disabled={props.disabled} tabIndex={0} value={props.input} onInput={updateInput} />
Schwehn42 marked this conversation as resolved.
Show resolved Hide resolved
{props.input && (
<div className="search-bar__icon-container search-bar__icon-container--clear-icon" role="button" tabIndex={0} onClick={clearInput}>
Schwehn42 marked this conversation as resolved.
Show resolved Hide resolved
<ClearIcon className="search-bar__icon" aria-label="clear button" />
</div>
)}
</div>
);
};
17 changes: 8 additions & 9 deletions src/components/SettingsDialog/Components/AvatarSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {Avatar, generateRandomProps} from "components/Avatar";
import {Fragment, useEffect, useState} from "react";
import {useTranslation} from "react-i18next";
import {useAppDispatch, useAppSelector} from "store";
import {isEqual} from "underscore";
import {AVATAR_CONFIG} from "constants/avatar";
import {AvataaarProps, AvatarGroup} from "types/avatar";
import {editSelf} from "store/features";
Expand All @@ -19,14 +18,9 @@ export interface AvatarSettingsProps {
export const AvatarSettings = (props: AvatarSettingsProps) => {
const dispatch = useAppDispatch();
const {t} = useTranslation();
const state = useAppSelector(
(applicationState) => ({
participant: applicationState.participants!.self!,
}),
isEqual
);
const self = useAppSelector((state) => state.auth.user!);

let initialState = state.participant?.user.avatar;
let initialState = self.avatar;
if (initialState === null || initialState === undefined) {
initialState = generateRandomProps(props.id ?? "");
}
Expand All @@ -46,7 +40,12 @@ export const AvatarSettings = (props: AvatarSettingsProps) => {
};

useEffect(() => {
dispatch(editSelf({...state.participant.user, avatar: properties}));
dispatch(
editSelf({
auth: {...self, avatar: properties},
applyOptimistically: true,
})
);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [properties]);

Expand Down
20 changes: 7 additions & 13 deletions src/components/SettingsDialog/ProfileSettings/ProfileSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {useAppDispatch, useAppSelector} from "store";
import {editSelf, setHotkeyState} from "store/features";
import {Info} from "components/Icon";
import {Toggle} from "components/Toggle";
import {isEqual} from "underscore";
import {useOutletContext} from "react-router";
import {MenuItemConfig} from "constants/settings";
import {getColorClassName} from "constants/colors";
Expand All @@ -20,16 +19,11 @@ export const ProfileSettings = () => {

const activeMenuItem: MenuItemConfig = useOutletContext();

const state = useAppSelector(
(applicationState) => ({
participant: applicationState.participants.self!,
hotkeysAreActive: applicationState.view.hotkeysAreActive,
}),
isEqual
);
const self = useAppSelector((state) => state.auth.user!);
const hotkeysAreActive = useAppSelector((state) => state.view.hotkeysAreActive);

const [userName, setUserName] = useState<string>(state.participant?.user.name);
const [id] = useState<string | undefined>(state.participant?.user.id);
const [userName, setUserName] = useState<string>(self.name);
const [id] = useState<string | undefined>(self.id);

return (
<div className={classNames("settings-dialog__container", getColorClassName(activeMenuItem?.color))}>
Expand All @@ -44,7 +38,7 @@ export const ProfileSettings = () => {
value={userName}
maxLength={64}
onChange={(e) => setUserName(e.target.value)}
submit={() => dispatch(editSelf({...state.participant.user, name: userName}))}
submit={() => dispatch(editSelf({auth: {...self, name: userName}, applyOptimistically: true}))}
/>

<AvatarSettings id={id} />
Expand All @@ -53,10 +47,10 @@ export const ProfileSettings = () => {
className="profile-settings__toggle-hotkeys-button"
label={t("Hotkeys.hotkeyToggle")}
onClick={() => {
dispatch(setHotkeyState(!state.hotkeysAreActive));
dispatch(setHotkeyState(!hotkeysAreActive));
}}
>
<Toggle active={state.hotkeysAreActive} />
<Toggle active={hotkeysAreActive} />
</SettingsButton>
<a className="profile-settings__open-cheat-sheet-button" href={`${process.env.PUBLIC_URL}/hotkeys.pdf`} target="_blank" rel="noopener noreferrer">
<p>{t("Hotkeys.cheatSheet")}</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SettingsDialog/SettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const SettingsDialog = (props: SettingsDialogProps) => {
const {t} = useTranslation();
const location = useLocation();
const navigate = useNavigate();
const me = useAppSelector((applicationState) => applicationState.participants?.self?.user)!;
const me = useAppSelector((state) => state.auth.user!);
const isBoardModerator = useAppSelector((state) => state.participants?.self?.role === "MODERATOR" || state.participants?.self?.role === "OWNER");

const [activeMenuItem, setActiveMenuItem] = useState<MenuItemConfig>();
Expand Down
Loading
Loading