mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-09 16:53:36 -05:00
Resolve remaining review notes
This commit is contained in:
parent
8ece647857
commit
c194fff7fd
5 changed files with 16 additions and 12 deletions
|
@ -33,7 +33,6 @@ const CategoryBase = styled.div<Pick<Props, 'variant'>>`
|
|||
|
||||
type Props = Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children' | 'as' | 'action'> & {
|
||||
text: Children;
|
||||
// TODO: rename from action to prevent type conflicts with the dom
|
||||
action?: () => void;
|
||||
variant?: 'default' | 'uniform';
|
||||
}
|
||||
|
|
|
@ -31,7 +31,14 @@ export type Variables =
|
|||
| "status-busy"
|
||||
| "status-streaming"
|
||||
| "status-invisible"
|
||||
| "sidebar-active";
|
||||
|
||||
// While this isn't used, it'd be good to keep this up to date as a reference or for future use
|
||||
export type HiddenVariables =
|
||||
| "font"
|
||||
| "ligatures"
|
||||
| "app-height"
|
||||
| "sidebar-active"
|
||||
| "monospace-font"
|
||||
|
||||
export type Fonts = 'Open Sans' | 'Inter' | 'Atkinson Hyperlegible' | 'Roboto' | 'Noto Sans' | 'Lato' | 'Bree Serif' | 'Montserrat' | 'Poppins' | 'Raleway' | 'Ubuntu' | 'Comic Neue';
|
||||
export type MonoscapeFonts = 'Fira Code' | 'Roboto Mono' | 'Source Code Pro' | 'Space Mono' | 'Ubuntu Mono';
|
||||
|
@ -215,8 +222,7 @@ export const PRESETS: Record<string, Theme> = {
|
|||
"status-away": "#F39F00",
|
||||
"status-busy": "#F84848",
|
||||
"status-streaming": "#977EFF",
|
||||
"status-invisible": "#A5A5A5",
|
||||
"sidebar-active": "var(--secondary-background)"
|
||||
"status-invisible": "#A5A5A5"
|
||||
},
|
||||
dark: {
|
||||
light: false,
|
||||
|
@ -243,8 +249,7 @@ export const PRESETS: Record<string, Theme> = {
|
|||
"status-away": "#F39F00",
|
||||
"status-busy": "#F84848",
|
||||
"status-streaming": "#977EFF",
|
||||
"status-invisible": "#A5A5A5",
|
||||
"sidebar-active": "var(--secondary-background)"
|
||||
"status-invisible": "#A5A5A5"
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -33,8 +33,7 @@ export interface VoiceState {
|
|||
participants?: Readonly<Map<string, VoiceUser>>;
|
||||
}
|
||||
|
||||
// [bree] TODO: I feel like these should be typechecked anyways but whatever,
|
||||
// I'm asserting that they aren't null because they get used near immedietly from what I can tell
|
||||
// They should be present from first render. - insert's words
|
||||
export const VoiceContext = createContext<VoiceState>(null!);
|
||||
export const VoiceOperationsContext = createContext<VoiceOperations>(null!);
|
||||
|
||||
|
|
|
@ -119,9 +119,8 @@ export function SpecialInputModal(props: SpecialProps) {
|
|||
question={<Text id="app.settings.permissions.create_role" />}
|
||||
field={<Text id="app.settings.permissions.role_name" />}
|
||||
callback={async name => {
|
||||
// bree: this returns void, dunno why props.callback was being called
|
||||
const role = await client.servers.createRole(props.server, name);
|
||||
// props.callback(role.id);
|
||||
props.callback(role.id);
|
||||
}}
|
||||
/>;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,9 @@ export interface ClientOperations {
|
|||
openDM: (user_id: string) => Promise<string>;
|
||||
}
|
||||
|
||||
// TODO: remove temporary non-null assertions and properly typecheck these as they aren't always immedietely initialized
|
||||
// By the time they are used, they should all be initialized.
|
||||
// Currently the app does not render until a client is built and the other two are always initialized on first render.
|
||||
// - insert's words
|
||||
export const AppContext = createContext<Client>(null!);
|
||||
export const StatusContext = createContext<ClientStatus>(null!);
|
||||
export const OperationsContext = createContext<ClientOperations>(null!);
|
||||
|
@ -94,7 +96,7 @@ function Context({ auth, children, dispatcher }: Props) {
|
|||
const login = () =>
|
||||
dispatcher({
|
||||
type: "LOGIN",
|
||||
session: client.session! // TODO: verify that this null assertion is correct
|
||||
session: client.session! // This [null assertion] is ok, we should have a session by now. - insert's words
|
||||
});
|
||||
|
||||
if (onboarding) {
|
||||
|
|
Loading…
Reference in a new issue