Fix i18n for server settings.

Start work on roles.
Add temporary age gate.
This commit is contained in:
Paul
2021-07-02 22:08:03 +01:00
parent a1d52f0cd9
commit a9763de707
6 changed files with 111 additions and 76 deletions

View File

@@ -5,6 +5,8 @@ import { useSelf } from "../../context/revoltjs/hooks";
import { useHistory, useLocation } from "react-router";
import ConditionalLink from "../../lib/ConditionalLink";
import { Message, Group } from "@styled-icons/boxicons-solid";
import { LastOpened } from "../../redux/reducers/last_opened";
import { connectState } from "../../redux/connector";
const NavigationBase = styled.div`
z-index: 100;
@@ -26,15 +28,23 @@ const Button = styled.a<{ active: boolean }>`
` }
`;
export default function BottomNavigation() {
interface Props {
lastOpened: LastOpened
}
export function BottomNavigation({ lastOpened }: Props) {
const user = useSelf();
const history = useHistory();
const path = useLocation().pathname;
const channel_id = lastOpened['home'];
const friendsActive = path.startsWith("/friends");
const settingsActive = path.startsWith("/settings");
const homeActive = !(friendsActive || settingsActive);
// console.info(channel_id);
return (
<NavigationBase>
<Button active={homeActive}>
@@ -70,3 +80,9 @@ export default function BottomNavigation() {
</NavigationBase>
);
}
export default connectState(BottomNavigation, state => {
return {
lastOpened: state.lastOpened
}
});