refactor: Migrate api key messages to constants
This commit is contained in:
parent
58317a3891
commit
cb3fc079c6
2 changed files with 15 additions and 9 deletions
|
|
@ -623,3 +623,13 @@ export const BASE_URL_API = "/api/v1/";
|
||||||
|
|
||||||
export const SIGN_UP_SUCCESS =
|
export const SIGN_UP_SUCCESS =
|
||||||
"Account created! Await admin activation. ";
|
"Account created! Await admin activation. ";
|
||||||
|
|
||||||
|
export const API_PAGE_PARAGRAPH_1 = "Your secret API keys are listed below. Please note that we do not display your secret API keys again after you generate them.";
|
||||||
|
|
||||||
|
export const API_PAGE_PARAGRAPH_2 = "Do not share your API key with others, or expose it in the browser or other client-side code.";
|
||||||
|
|
||||||
|
export const API_PAGE_USER_KEYS = "This user does not have any keys assigned at the moment."
|
||||||
|
|
||||||
|
export const LAST_USED_SPAN_1 = "The last time this key was used.";
|
||||||
|
|
||||||
|
export const LAST_USED_SPAN_2 = "Accurate to within the hour from the most recent usage.";
|
||||||
|
|
@ -19,6 +19,7 @@ import SecretKeyModal from "../../modals/SecretKeyModal";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import Header from "../../components/headerComponent";
|
import Header from "../../components/headerComponent";
|
||||||
import { ApiKey } from "../../types/components";
|
import { ApiKey } from "../../types/components";
|
||||||
|
import { API_PAGE_PARAGRAPH_1, API_PAGE_PARAGRAPH_2, API_PAGE_USER_KEYS, LAST_USED_SPAN_1, LAST_USED_SPAN_2 } from "../../constants/constants";
|
||||||
|
|
||||||
export default function ApiKeysPage() {
|
export default function ApiKeysPage() {
|
||||||
const [loadingKeys, setLoadingKeys] = useState(true);
|
const [loadingKeys, setLoadingKeys] = useState(true);
|
||||||
|
|
@ -72,8 +73,7 @@ export default function ApiKeysPage() {
|
||||||
return (
|
return (
|
||||||
<div className="text-xs">
|
<div className="text-xs">
|
||||||
<span>
|
<span>
|
||||||
The last time this key was used.<br></br> Accurate to within the hour
|
{LAST_USED_SPAN_1}<br></br> {LAST_USED_SPAN_2}
|
||||||
from the most recent usage.
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
@ -93,11 +93,8 @@ export default function ApiKeysPage() {
|
||||||
API keys
|
API keys
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-muted-foreground">
|
<p className="text-muted-foreground">
|
||||||
Your secret API keys are listed below. Please note that we
|
{API_PAGE_PARAGRAPH_1}<br />
|
||||||
do not display your secret API keys again after you
|
{API_PAGE_PARAGRAPH_2}
|
||||||
generate them.<br></br>
|
|
||||||
Do not share your API key with others, or expose it in the
|
|
||||||
browser or other client-side code.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center space-x-2"></div>
|
<div className="flex items-center space-x-2"></div>
|
||||||
|
|
@ -109,8 +106,7 @@ export default function ApiKeysPage() {
|
||||||
<>
|
<>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<h2>
|
<h2>
|
||||||
This user does not have any keys assigned at the
|
{API_PAGE_USER_KEYS}
|
||||||
moment.
|
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue