mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
made transitional Anchor component for next/cra
This commit is contained in:
parent
8bac6bb2f7
commit
7658068caa
12 changed files with 57 additions and 28 deletions
|
@ -1,5 +1,7 @@
|
|||
export const CONFIG = {
|
||||
API_HOST: process.env.REACT_APP_API_HOST || process.env.NEXT_PUBLIC_API_HOST || '',
|
||||
REMOTE_CURRENT:
|
||||
apiHost: process.env.REACT_APP_API_HOST || process.env.NEXT_PUBLIC_API_HOST || '',
|
||||
remoteCurrent:
|
||||
process.env.REACT_APP_REMOTE_CURRENT || process.env.NEXT_PUBLIC_REMOTE_CURRENT || '',
|
||||
// transitional prop, marks migration to nextjs
|
||||
isNextEnvironment: false,
|
||||
};
|
||||
|
|
|
@ -68,10 +68,10 @@ export const getURLFromString = (
|
|||
size?: typeof PRESETS[keyof typeof PRESETS]
|
||||
): string => {
|
||||
if (size) {
|
||||
return (url || '').replace('REMOTE_CURRENT://', `${CONFIG.REMOTE_CURRENT}cache/${size}/`);
|
||||
return (url || '').replace('REMOTE_CURRENT://', `${CONFIG.remoteCurrent}cache/${size}/`);
|
||||
}
|
||||
|
||||
return (url || '').replace('REMOTE_CURRENT://', CONFIG.REMOTE_CURRENT);
|
||||
return (url || '').replace('REMOTE_CURRENT://', CONFIG.remoteCurrent);
|
||||
};
|
||||
|
||||
export const getURL = (
|
||||
|
|
|
@ -16,3 +16,8 @@ export type ButtonProps = React.DetailedHTMLProps<
|
|||
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
HTMLButtonElement
|
||||
>;
|
||||
|
||||
export type LinkProps = React.DetailedHTMLProps<
|
||||
React.AnchorHTMLAttributes<HTMLAnchorElement>,
|
||||
HTMLAnchorElement
|
||||
>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue