Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog box text update #419

Merged
merged 1 commit into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const getGroups = (groups: Array<any>) => (
<p className={styles.GroupsText}>{groups.map((group: any) => group.label).join(', ')}</p>
);

const dialogMessage = 'This contact will be permanently removed from this group';
const dialogTitle = 'Are you sure you want to remove contact from this group?';
const dialogMessage = 'The contact will no longer receive messages sent to this group';
const columnStyles = [styles.Name, styles.Phone, styles.Actions];
const groupIcon = <GroupIcon className={styles.GroupIcon} />;

Expand Down Expand Up @@ -57,6 +58,7 @@ export const GroupContactList: React.SFC<GroupContactListProps> = (props) => {
};
return (
<List
dialogTitle={dialogTitle}
columnNames={columnNames}
title={props.title}
listItem="contacts"
Expand Down
2 changes: 1 addition & 1 deletion src/containers/List/List.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
}

.DialogText {
max-width: 395px;
max-width: 347px;
margin-top: 0px;
text-align: center;
color: #073f24;
Expand Down
10 changes: 8 additions & 2 deletions src/containers/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Redirect, Link } from 'react-router-dom';
import { useQuery, useMutation, DocumentNode } from '@apollo/client';
import { useApolloClient } from '@apollo/client';
import { setNotification, setErrorMessage } from '../../common/notification';
import { IconButton, Typography } from '@material-ui/core';
import { IconButton, Typography, DialogTitle } from '@material-ui/core';
import { Button } from '../../components/UI/Form/Button/Button';
import { Loading } from '../../components/UI/Layout/Loading/Loading';
import { Pager } from '../../components/UI/Pager/Pager';
Expand Down Expand Up @@ -51,6 +51,7 @@ export interface ListProps {
variables: any;
};
refetchQueries?: any;
dialogTitle?: string;
}

interface TableVals {
Expand All @@ -73,6 +74,7 @@ export const List: React.SFC<ListProps> = ({
columns,
columnStyles,
title,
dialogTitle,
button = {
show: true,
label: 'Add New',
Expand Down Expand Up @@ -195,7 +197,11 @@ export const List: React.SFC<ListProps> = ({
if (deleteItemID) {
dialogBox = (
<DialogBox
title={`Are you sure you want to delete the ${listItemName} "${deleteItemName}"?`}
title={
dialogTitle
? dialogTitle
: `Are you sure you want to delete the ${listItemName} "${deleteItemName}"?`
}
handleOk={handleDeleteItem}
handleCancel={closeDialogBox}
colorOk="secondary"
Expand Down