-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9169d0
commit 19354c9
Showing
10 changed files
with
76 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export * from './pagination.model'; | ||
export * from './lookup.model'; | ||
export * from './collection.model'; | ||
export * from './tabs.model'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as React from 'react'; | ||
import { useWithTheme } from '#core/theme/theme.hooks.ts'; | ||
import * as innerClasses from './tabs.styles'; | ||
|
||
interface TabPanelProps { | ||
index: number; | ||
value: number; | ||
children: React.ReactNode; | ||
} | ||
|
||
export const TabPanel = (props: TabPanelProps) => { | ||
const { children, value, index } = props; | ||
const classes = useWithTheme(innerClasses); | ||
|
||
return value === index && <div className={classes.tabPanel}>{children}</div>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import * as React from 'react'; | ||
import { TabPanel } from './tab-panel.component'; | ||
import { Tabs as MUITabs, Tab, Paper } from '@mui/material/'; | ||
|
||
import * as innerClasses from './tabs.styles'; | ||
|
||
enum TabIndex { | ||
USER_SHEET, | ||
RESET_PASSWORD, | ||
} | ||
|
||
interface Props { | ||
id: string; | ||
} | ||
|
||
export const Tabs: React.FC<Props> = ({ id }) => { | ||
const [activeTab, setActiveTab] = React.useState<number>(0); | ||
|
||
const handleChange = (_event: React.SyntheticEvent, newValue: number) => setActiveTab(newValue); | ||
|
||
return ( | ||
<div className={innerClasses.tabsComponent}> | ||
<Paper elevation={0}> | ||
<div className={innerClasses.tabsContainer}> | ||
<MUITabs value={activeTab} onChange={handleChange}> | ||
<Tab label="Ficha de usuario" /> | ||
<Tab label="Resetear Password" /> | ||
</MUITabs> | ||
</div> | ||
<TabPanel value={activeTab} index={TabIndex.USER_SHEET}> | ||
<h3>User id: {id}</h3> | ||
</TabPanel> | ||
<TabPanel value={activeTab} index={TabIndex.RESET_PASSWORD}> | ||
<h3>Reset Password</h3> | ||
</TabPanel> | ||
</Paper> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { css } from '@emotion/css'; | ||
import { Theme } from '@mui/material'; | ||
|
||
export const tabsComponent = css` | ||
display: 'flex'; | ||
flexdirection: 'column'; | ||
alignitems: 'center'; | ||
width: 100%; | ||
`; | ||
|
||
export const tabsContainer = css` | ||
border-bottom: 1; | ||
border-color: 'divider'; | ||
`; | ||
|
||
export const tabPanel = (theme: Theme) => css` | ||
padding-block: ${theme.spacing(2)}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters