-
Notifications
You must be signed in to change notification settings - Fork 7
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
Arenaform new design #2020
Arenaform new design #2020
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
condition?: boolean, | ||
) => { | ||
if (!condition && isActive) { | ||
return setToolbarValues((prev) => [...prev.filter((val) => val !== format)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hvorfor trenger vi å spreade her?
if (!condition && isActive) { | ||
return setToolbarValues((prev) => [...prev.filter((val) => val !== format)]); | ||
} else if (condition && !isActive) { | ||
return setToolbarValues((prev) => [...prev, format]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dette kan vel bare være en concat?
@@ -69,18 +71,34 @@ interface EditorToolbarProps { | |||
editorIsFocused: boolean; | |||
} | |||
|
|||
const selectionHasFormat = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synes ikke navnet på denne funksjonen reflekterer det som faktisk skjer i den.
setIsNumberedList(type === "number"); | ||
|
||
if (type === "bullet") { | ||
return !isUnorderedList && setToolbarValues((prev) => [...prev.filter(filterList), "unordered"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unødvendig spread?
if (type === "bullet") { | ||
return !isUnorderedList && setToolbarValues((prev) => [...prev.filter(filterList), "unordered"]); | ||
} else { | ||
return !isOrderedList && setToolbarValues((prev) => [...prev.filter(filterList), "ordered"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trenger dette å være en spread?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ser ut som at vi nester P
i P
her. Sjekk content
@@ -184,9 +171,10 @@ const ArenaForm = ({ onSave, onAbort, type, initialTitle, initialContent, initia | |||
shouldDirty: true, | |||
}); | |||
}} | |||
initialValue={initialContent ?? ""} | |||
initialValue={initialContent ?? "<p></p>"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hvorfor er det endring her?
const ButtonRow = styled(HStack, { | ||
base: { | ||
width: "100%", | ||
"& > button": { | ||
flexGrow: "1", | ||
}, | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Her tror jeg vi kan forenkle litt, faktisk. Hva med å gjøre det til en grid
som har 1fr 1fr
? Da kan vi droppe stack og flexGrow
onClick={insertLink} | ||
aria-label={linkLabel} | ||
title={linkLabel} | ||
aria-selected={isLink} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vi trenger vel ikke aria-selected?
Nytt design på arenaform.