mirror of
https://github.com/spacebarchat/client.git
synced 2024-11-22 02:12:38 +01:00
update settings modal
This commit is contained in:
parent
e09e59ea5c
commit
2787a72b71
@ -1,22 +1,18 @@
|
||||
#[cfg(desktop)]
|
||||
use tauri::Manager;
|
||||
|
||||
#[cfg(desktop)]
|
||||
#[tauri::command]
|
||||
async fn close_splashscreen(window: tauri::Window) {
|
||||
// Close splashscreen
|
||||
if let Some(splashscreen) = window.get_window("splashscreen") {
|
||||
splashscreen.close().unwrap();
|
||||
#[cfg(desktop)]
|
||||
{
|
||||
// Close splashscreen
|
||||
if let Some(splashscreen) = window.get_window("splashscreen") {
|
||||
splashscreen.close().unwrap();
|
||||
}
|
||||
|
||||
// Show main window
|
||||
window.get_window("main").unwrap().show().unwrap();
|
||||
}
|
||||
|
||||
// Show main window
|
||||
window.get_window("main").unwrap().show().unwrap();
|
||||
}
|
||||
|
||||
#[cfg(mobile)]
|
||||
#[tauri::command]
|
||||
async fn close_splashscreen() {
|
||||
// just a dummy function for mobile
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
|
@ -158,24 +158,51 @@ export const ModalFooter = styled.div`
|
||||
export const ModalFullSidebar = styled.div`
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
flex: 1 0 11.35%;
|
||||
flex: 1 0 15%;
|
||||
z-index: 1;
|
||||
background-color: var(--background-secondary);
|
||||
padding: 10px;
|
||||
`;
|
||||
|
||||
export const ModalFullSidebarContainer = styled.div`
|
||||
overflow: hidden scroll;
|
||||
flex: 1 0 auto;
|
||||
flex-direction: row;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
background-color: var(--background-secondary);
|
||||
`;
|
||||
|
||||
export const ModalFullSidebarContent = styled.div`
|
||||
width: 200px;
|
||||
padding: 40px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
`;
|
||||
|
||||
export const ModalFullContent = styled.div`
|
||||
position: relative;
|
||||
export const ModalFullContentContainer = styled.div`
|
||||
display: flex;
|
||||
flex: 1 1 42.3%;
|
||||
flex: 1 1 700px;
|
||||
align-items: flex-start;
|
||||
`;
|
||||
|
||||
export const ModalFullContentWrapper = styled.div`
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
`;
|
||||
|
||||
export const ModalFullContentContainerContentWrapper = styled.div`
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
background-color: var(--background-primary);
|
||||
padding: 10px;
|
||||
`;
|
||||
|
||||
export const ModalFullContent = styled.div`
|
||||
padding: 50px;
|
||||
flex: 1 1 auto;
|
||||
max-width: 80%;
|
||||
min-width: 50%;
|
||||
min-height: 100%;
|
||||
`;
|
||||
|
||||
interface ModalProps extends StackedModalProps {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { useModals } from "@mattjennings/react-modal-stack";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { useAppStore } from "../../stores/AppStore";
|
||||
import { GIT_BRANCH, GIT_REVISION, REPO_URL } from "../../utils/revison";
|
||||
import Button from "../Button";
|
||||
@ -7,7 +8,11 @@ import {
|
||||
Modal,
|
||||
ModalCloseWrapper,
|
||||
ModalFullContent,
|
||||
ModalFullContentContainer,
|
||||
ModalFullContentContainerContentWrapper,
|
||||
ModalFullContentWrapper,
|
||||
ModalFullSidebar,
|
||||
ModalFullSidebarContainer,
|
||||
ModalFullSidebarContent,
|
||||
} from "./ModalComponents";
|
||||
import { AnimatedModalProps } from "./ModalRenderer";
|
||||
@ -24,53 +29,60 @@ function SettingsModal(props: AnimatedModalProps) {
|
||||
return (
|
||||
<Modal full {...props}>
|
||||
<ModalFullSidebar>
|
||||
<ModalFullSidebarContent>
|
||||
Sidebar
|
||||
<div>
|
||||
<ModalFullSidebarContainer>
|
||||
<ModalFullSidebarContent>
|
||||
SIDEBAR
|
||||
<Button variant="danger" onClick={logout}>
|
||||
Logout
|
||||
</Button>
|
||||
</div>
|
||||
</ModalFullSidebarContent>
|
||||
</ModalFullSidebarContent>
|
||||
</ModalFullSidebarContainer>
|
||||
</ModalFullSidebar>
|
||||
|
||||
<ModalFullContent>
|
||||
<ModalCloseWrapper>
|
||||
<button
|
||||
onClick={closeModal}
|
||||
style={{
|
||||
background: "none",
|
||||
border: "none",
|
||||
outline: "none",
|
||||
}}
|
||||
>
|
||||
<Icon
|
||||
icon="mdiClose"
|
||||
size={1}
|
||||
style={{
|
||||
cursor: "pointer",
|
||||
color: "var(--text)",
|
||||
}}
|
||||
/>
|
||||
</button>
|
||||
</ModalCloseWrapper>
|
||||
<div>
|
||||
<span>Client Version: </span>
|
||||
<a href={`${REPO_URL}/commit/${GIT_REVISION}`} target="_blank" rel="noreferrer">
|
||||
{GIT_REVISION.substring(0, 7)}
|
||||
</a>
|
||||
{` `}
|
||||
<a
|
||||
href={GIT_BRANCH !== "DETACHED" ? `${REPO_URL}/tree/${GIT_BRANCH}` : undefined}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
({GIT_BRANCH})
|
||||
</a>
|
||||
</div>
|
||||
</ModalFullContent>
|
||||
<ModalFullContentContainer>
|
||||
<ModalFullContentWrapper>
|
||||
<ModalFullContentContainerContentWrapper>
|
||||
<ModalFullContent>
|
||||
<ModalCloseWrapper>
|
||||
<button
|
||||
onClick={closeModal}
|
||||
style={{
|
||||
background: "none",
|
||||
border: "none",
|
||||
outline: "none",
|
||||
}}
|
||||
>
|
||||
<Icon
|
||||
icon="mdiClose"
|
||||
size={1}
|
||||
style={{
|
||||
cursor: "pointer",
|
||||
color: "var(--text)",
|
||||
}}
|
||||
/>
|
||||
</button>
|
||||
</ModalCloseWrapper>
|
||||
|
||||
<div>
|
||||
<span>Client Version: </span>
|
||||
<a href={`${REPO_URL}/commit/${GIT_REVISION}`} target="_blank" rel="noreferrer">
|
||||
{GIT_REVISION.substring(0, 7)}
|
||||
</a>
|
||||
{` `}
|
||||
<a
|
||||
href={GIT_BRANCH !== "DETACHED" ? `${REPO_URL}/tree/${GIT_BRANCH}` : undefined}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
({GIT_BRANCH})
|
||||
</a>
|
||||
</div>
|
||||
</ModalFullContent>
|
||||
</ModalFullContentContainerContentWrapper>
|
||||
</ModalFullContentWrapper>
|
||||
</ModalFullContentContainer>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
export default SettingsModal;
|
||||
export default observer(SettingsModal);
|
||||
|
Loading…
Reference in New Issue
Block a user