mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-05 19:59:20 +00:00
Update AppBar.tsx
This commit is contained in:
@@ -50,7 +50,9 @@ export const AppBar: FC<Props> = ({ children }) => {
|
|||||||
|
|
||||||
const [title, setTitle] = useState<string>("");
|
const [title, setTitle] = useState<string>("");
|
||||||
const [hidden, setHidden] = useState<boolean>(false);
|
const [hidden, setHidden] = useState<boolean>(false);
|
||||||
const [secondaryButton, setSecondaryButton] = useState<ReactNode>(null);
|
const [secondaryButton, setSecondaryButton] = useState<ReactNode | null>(
|
||||||
|
null,
|
||||||
|
);
|
||||||
const context = useMemo(
|
const context = useMemo(
|
||||||
() => ({ setTitle, setSecondaryButton, setHidden }),
|
() => ({ setTitle, setSecondaryButton, setHidden }),
|
||||||
[setTitle, setHidden, setSecondaryButton],
|
[setTitle, setHidden, setSecondaryButton],
|
||||||
@@ -86,7 +88,7 @@ export const AppBar: FC<Props> = ({ children }) => {
|
|||||||
{title}
|
{title}
|
||||||
</Heading>
|
</Heading>
|
||||||
)}
|
)}
|
||||||
<RightNav>{secondaryButton}</RightNav>
|
<RightNav>{secondaryButton ?? "x"}</RightNav>
|
||||||
</Header>
|
</Header>
|
||||||
</div>
|
</div>
|
||||||
<AppBarContext value={context}>{children}</AppBarContext>
|
<AppBarContext value={context}>{children}</AppBarContext>
|
||||||
|
|||||||
Reference in New Issue
Block a user