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

enhance api-key-table and modal according to figma design #434

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 1 addition & 2 deletions client/src/components/admindashboard/ReuploadImageModal.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
.modal-content {
display: flex;
flex-direction: column;
align-items: center;

justify-content: center;
background: #fff;
padding: 20px;
border-radius: 5px;
width: auto;
height: auto;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-close-button {
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/common/modal/Modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
width: 100%;
background: linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
z-index: 1;
backdrop-filter: blur(2px);

position: fixed;
inset: 0;
display: flex;
Expand All @@ -12,7 +12,7 @@
}

.modal-container {
max-width: 500px;
max-width: 400px;
background-color: white;
padding: 30px 14px 20px;
margin: 30px 16px;
Expand Down
12 changes: 6 additions & 6 deletions client/src/components/dashboard/ApiKeyTable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import PropTypes from 'prop-types';
import {MdDeleteOutline} from 'react-icons/md';
import {formatDate} from '../../utils/helpers';
import Modal from '../common/modal/Modal';
import {useRef, useState} from 'react';
Expand All @@ -25,9 +24,9 @@ function ApiKeyTable({keys, deleteKey, handleCloseKey}) {
<table>
<thead>
<tr>
<th>DESCRIPTION</th>
<th>ACTION</th>
<th>CREATE DATE</th>
<th>Description</th>
<th>Created </th>
{/* <th>CREATE DATE</th> */}
</tr>
</thead>
<tbody>
Expand All @@ -42,16 +41,17 @@ function ApiKeyTable({keys, deleteKey, handleCloseKey}) {
{keys.map((key, index) => (
<tr key={index}>
<td>{key.keyDescription}</td>
<td>{formatDate(key?.createdAt)}</td>
<td>
<button
className='api-key-delete-button'
data-testid='api-key-delete'
onClick={() => showConfirmationModal(key.keyId)}
>
<MdDeleteOutline />
{/* <MdDeleteOutline /> */}
Delete
</button>
</td>
<td>{formatDate(key?.createdAt)}</td>
</tr>
))}
</tbody>
Expand Down
16 changes: 11 additions & 5 deletions client/src/pages/dashboard/Dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
.api-key-table {
padding: 0px;
width: 100%;
text-align: center;
text-align: start;
}

.api-key-table .content-item-heading {
Expand All @@ -259,22 +259,26 @@
.api-key-table table {
font-style: normal;
font-size: var(--medium-text);
background-color: rgb(247, 245, 247);
line-height: 175%;
border-spacing: 0;
white-space: nowrap;
}

.api-key-table thead tr th {
background-color: rgb(226, 224, 224);
padding: 8px;
font-weight: 500;
padding-left: 15px;
background-color: rgb(247, 245, 247);
font-weight: 400;
text-align: start;
color: var(--smooth-gray);
}

.api-key-table tbody tr td {
padding: 8px;
padding-left: 15px;
font-weight: 400;
color: var(--smooth-gray);
color: black;
border-top: var(--border);
}

Expand All @@ -287,7 +291,9 @@
.api-key-delete-button {
margin: 0 auto;
border: none;
border-radius: 99px;
color: red;
background-color: #fff;
border-radius: 5px;
display: flex;
align-items: center;
padding: 8px 12px;
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/dashboard/Dashboard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Dashboard Component', () => {
expect(usageComponent).toBeInTheDocument();
const apiKeyFormComponent = screen.getByText('Generate your API key');
expect(apiKeyFormComponent).toBeInTheDocument();
const apiKeyTableComponent = screen.getByText('DESCRIPTION');
const apiKeyTableComponent = screen.getByText('Description');
expect(apiKeyTableComponent).toBeInTheDocument();
});

Expand Down