Skip to content

Commit

Permalink
test toast
Browse files Browse the repository at this point in the history
  • Loading branch information
abe garcia committed Jun 29, 2023
1 parent 4e856a3 commit f586f33
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import { makeStyles } from '@material-ui/core';
import type { ChangeEvent } from 'react';
import React, { useState } from 'react';
import { toast, ToastContainer } from 'react-toastify';

import type { IExecution } from '@spinnaker/core';

Expand All @@ -21,6 +22,8 @@ import { TableHeaders } from './TableHeaders';
import { ActionButtonsContainer, PauseResumeButton, RetriggerButton } from '../actions';
import { DEFAULT_ROWS_PER_PAGE } from './constants';

import 'react-toastify/dist/ReactToastify.css';

const useStyles = makeStyles({
tableContainer: { borderRadius: 'inherit' },
pagination: { fontSize: '1rem', margin: 'auto' },
Expand Down Expand Up @@ -71,7 +74,11 @@ export const ExecutionsTable = ({ executions, parameters, refreshExecutions }: I
};

const isSelected = (name: string) => selectedExecutionIds.indexOf(name) !== -1;

const showToastMessage = () => {
toast.success('Success Notification !', {
position: toast.POSITION.TOP_RIGHT,
});
};
return (
<TableContainer component={Paper} classes={{ root: styles.tableContainer }}>
<Table stickyHeader>
Expand Down Expand Up @@ -128,6 +135,10 @@ export const ExecutionsTable = ({ executions, parameters, refreshExecutions }: I
</TableRow>
</TableFooter>
</Table>
<div>
<button onClick={showToastMessage}>Notify</button>
<ToastContainer />
</div>
</TableContainer>
);
};

0 comments on commit f586f33

Please sign in to comment.