Skip to content

Commit

Permalink
💄 Align Save/Close Button for TickerModalForm
Browse files Browse the repository at this point in the history
  • Loading branch information
0x46616c6b committed Jan 24, 2023
1 parent 5045a97 commit 052a336
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/components/ticker/TickerForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { MapContainer, Marker, TileLayer } from 'react-leaflet'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import {
Alert,
Box,
Button,
Checkbox,
FormControlLabel,
Expand All @@ -18,7 +17,6 @@ import {
Stack,
TextField,
Typography,
useTheme,
} from '@mui/material'
import {
faComputerMouse,
Expand Down Expand Up @@ -80,7 +78,6 @@ const TickerForm: FC<Props> = ({ callback, id, ticker }) => {
const { token } = useAuth()
const { postTicker, putTicker } = useTickerApi(token)
const queryClient = useQueryClient()
const theme = useTheme()

const onLocationChange = useCallback(
(result: Result) => {
Expand Down Expand Up @@ -310,22 +307,6 @@ const TickerForm: FC<Props> = ({ callback, id, ticker }) => {
</Grid>
) : null}
</Grid>
<Grid item textAlign="right" xs={12}>
<Box sx={{ pt: theme.spacing(2) }}>
<Button
color="primary"
form="tickerForm"
sx={{ mr: theme.spacing(1) }}
type="submit"
variant="contained"
>
Save
</Button>
<Button color="secondary" onClick={() => callback()}>
Close
</Button>
</Box>
</Grid>
</form>
)
}
Expand Down
17 changes: 17 additions & 0 deletions src/components/ticker/TickerModalForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Close } from '@mui/icons-material'
import {
Button,
Dialog,
DialogActions,
DialogContent,
DialogTitle,
IconButton,
Expand Down Expand Up @@ -59,6 +61,21 @@ const TickerModalForm: FC<Props> = ({ onClose, open, ticker }) => {
</TabPanel>
) : null}
</DialogContent>
<DialogActions>
{tabValue === 0 ? (
<Button
color="primary"
form="tickerForm"
type="submit"
variant="contained"
>
Save
</Button>
) : null}
<Button color="secondary" onClick={handleClose}>
Close
</Button>
</DialogActions>
</Dialog>
)
}
Expand Down

0 comments on commit 052a336

Please sign in to comment.