parent
d408f312c2
commit
ee5b80fadb
5 changed files with 116 additions and 0 deletions
@ -0,0 +1,52 @@ |
||||
import React, { useReducer } from 'react'; |
||||
import { WindowState } from "../Windows"; |
||||
import { Box, Paper, Typography, TextField, Button, Tabs, Tab, Divider, IconButton } from "@material-ui/core"; |
||||
import { useHistory } from 'react-router'; |
||||
import { useAuth, Auth } from '../../../lib/useAuth'; |
||||
import Alert from '@material-ui/lab/Alert'; |
||||
import { Link } from 'react-router-dom'; |
||||
import LocalOfferIcon from '@material-ui/icons/LocalOffer'; |
||||
import OpenInNewIcon from '@material-ui/icons/OpenInNew'; |
||||
import ManageLinksWindow from '../manage_links/ManageLinksWindow'; |
||||
|
||||
export enum ManageWhat { |
||||
Tags = 0, |
||||
Links, |
||||
} |
||||
|
||||
export interface ManageWindowState extends WindowState { |
||||
dummy: boolean |
||||
} |
||||
export enum ManageWindowActions { |
||||
SetDummy = "SetDummy", |
||||
} |
||||
export function ManageWindowReducer(state: ManageWindowState, action: any) { |
||||
switch (action.type) { |
||||
case ManageWindowActions.SetDummy: { |
||||
return state; |
||||
} |
||||
default: |
||||
throw new Error("Unimplemented ManageWindow state update.") |
||||
} |
||||
} |
||||
|
||||
export default function ManageWindow(props: {}) { |
||||
const [state, dispatch] = useReducer(ManageWindowReducer, { |
||||
dummy: true, |
||||
}); |
||||
|
||||
return <ManageWindowControlled state={state} dispatch={dispatch} /> |
||||
} |
||||
|
||||
export function ManageWindowControlled(props: { |
||||
state: ManageWindowState, |
||||
dispatch: (action: any) => void, |
||||
}) { |
||||
return <Box display="flex" alignItems="top" height="100%" m={2}> |
||||
<Box display="flex" flexDirection="column" alignItems="center"> |
||||
<Box mt={2}><IconButton size="small"><LocalOfferIcon/></IconButton>Tags</Box> |
||||
<Box mt={2}><IconButton size="small"><OpenInNewIcon/></IconButton>Links</Box> |
||||
</Box> |
||||
<ManageLinksWindow /> |
||||
</Box> |
||||
} |
@ -0,0 +1,38 @@ |
||||
import React, { useReducer } from 'react'; |
||||
import { WindowState } from "../Windows"; |
||||
import { Box, Paper, Typography, TextField, Button } from "@material-ui/core"; |
||||
import { useHistory } from 'react-router'; |
||||
import { useAuth, Auth } from '../../../lib/useAuth'; |
||||
import Alert from '@material-ui/lab/Alert'; |
||||
import { Link } from 'react-router-dom'; |
||||
|
||||
export interface ManageLinksWindowState extends WindowState { |
||||
dummy: boolean |
||||
} |
||||
export enum ManageLinksWindowActions { |
||||
SetDummy = "SetDummy", |
||||
} |
||||
export function ManageLinksWindowReducer(state: ManageLinksWindowState, action: any) { |
||||
switch (action.type) { |
||||
case ManageLinksWindowActions.SetDummy: { |
||||
return state; |
||||
} |
||||
default: |
||||
throw new Error("Unimplemented ManageLinksWindow state update.") |
||||
} |
||||
} |
||||
|
||||
export default function ManageLinksWindow(props: {}) { |
||||
const [state, dispatch] = useReducer(ManageLinksWindowReducer, { |
||||
dummy: true, |
||||
}); |
||||
|
||||
return <ManageLinksWindowControlled state={state} dispatch={dispatch} /> |
||||
} |
||||
|
||||
export function ManageLinksWindowControlled(props: { |
||||
state: ManageLinksWindowState, |
||||
dispatch: (action: any) => void, |
||||
}) { |
||||
return <>Hi!</>; |
||||
} |
Loading…
Reference in new issue