refactor: convert config variables to upper case
This commit is contained in:
@@ -49,7 +49,7 @@ const SignInForm = () => {
|
||||
>
|
||||
Welcome back
|
||||
</Title>
|
||||
{config.get("allowRegistration") && (
|
||||
{config.get("ALLOW_REGISTRATION") && (
|
||||
<Text color="dimmed" size="sm" align="center" mt={5}>
|
||||
You don't have an account yet?{" "}
|
||||
<Anchor component={Link} href={"signUp"} size="sm">
|
||||
@@ -65,6 +65,7 @@ const SignInForm = () => {
|
||||
>
|
||||
<TextInput
|
||||
label="Email or username"
|
||||
type="email"
|
||||
placeholder="you@email.com"
|
||||
{...form.getInputProps("emailOrUsername")}
|
||||
/>
|
||||
|
||||
@@ -57,7 +57,7 @@ const SignUpForm = () => {
|
||||
>
|
||||
Sign up
|
||||
</Title>
|
||||
{config.get("allowRegistration") && (
|
||||
{config.get("ALLOW_REGISTRATION") && (
|
||||
<Text color="dimmed" size="sm" align="center" mt={5}>
|
||||
You have an account already?{" "}
|
||||
<Anchor component={Link} href={"signIn"} size="sm">
|
||||
@@ -78,6 +78,7 @@ const SignUpForm = () => {
|
||||
/>
|
||||
<TextInput
|
||||
label="Email"
|
||||
type="email"
|
||||
placeholder="you@email.com"
|
||||
mt="md"
|
||||
{...form.getInputProps("email")}
|
||||
|
||||
@@ -130,7 +130,7 @@ const NavBar = () => {
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
if (config.get("showHomePage"))
|
||||
if (config.get("SHOW_HOME_PAGE"))
|
||||
setUnauthenticatedLinks((array) => [
|
||||
{
|
||||
link: "/",
|
||||
@@ -139,7 +139,7 @@ const NavBar = () => {
|
||||
...array,
|
||||
]);
|
||||
|
||||
if (config.get("allowRegistration"))
|
||||
if (config.get("ALLOW_REGISTRATION"))
|
||||
setUnauthenticatedLinks((array) => [
|
||||
...array,
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ const Dropzone = ({
|
||||
return (
|
||||
<div className={classes.wrapper}>
|
||||
<MantineDropzone
|
||||
maxSize={parseInt(config.get("maxFileSize"))}
|
||||
maxSize={parseInt(config.get("MAX_FILE_SIZE"))}
|
||||
onReject={(e) => {
|
||||
toast.error(e[0].errors[0].message);
|
||||
}}
|
||||
@@ -75,7 +75,7 @@ const Dropzone = ({
|
||||
<Text align="center" size="sm" mt="xs" color="dimmed">
|
||||
Drag'n'drop files here to start your share. We can accept
|
||||
only files that are less than{" "}
|
||||
{byteStringToHumanSizeString(config.get("maxFileSize"))} in size.
|
||||
{byteStringToHumanSizeString(config.get("MAX_FILE_SIZE"))} in size.
|
||||
</Text>
|
||||
</div>
|
||||
</MantineDropzone>
|
||||
|
||||
@@ -29,8 +29,8 @@ const showCreateUploadModal = (
|
||||
modals: ModalsContextProps,
|
||||
options: {
|
||||
isUserSignedIn: boolean;
|
||||
allowUnauthenticatedShares: boolean;
|
||||
emailRecipientsEnabled: boolean;
|
||||
ALLOW_UNAUTHENTICATED_SHARES: boolean;
|
||||
ENABLE_EMAIL_RECIPIENTS: boolean;
|
||||
},
|
||||
uploadCallback: (
|
||||
id: string,
|
||||
@@ -62,14 +62,14 @@ const CreateUploadModalBody = ({
|
||||
) => void;
|
||||
options: {
|
||||
isUserSignedIn: boolean;
|
||||
allowUnauthenticatedShares: boolean;
|
||||
emailRecipientsEnabled: boolean;
|
||||
ALLOW_UNAUTHENTICATED_SHARES: boolean;
|
||||
ENABLE_EMAIL_RECIPIENTS: boolean;
|
||||
};
|
||||
}) => {
|
||||
const modals = useModals();
|
||||
|
||||
const [showNotSignedInAlert, setShowNotSignedInAlert] = useState(
|
||||
options.emailRecipientsEnabled
|
||||
options.ENABLE_EMAIL_RECIPIENTS
|
||||
);
|
||||
|
||||
const validationSchema = yup.object().shape({
|
||||
@@ -230,7 +230,7 @@ const CreateUploadModalBody = ({
|
||||
{ExpirationPreview({ form })}
|
||||
</Text>
|
||||
<Accordion>
|
||||
{options.emailRecipientsEnabled && (
|
||||
{options.ENABLE_EMAIL_RECIPIENTS && (
|
||||
<Accordion.Item value="recipients" sx={{ borderBottom: "none" }}>
|
||||
<Accordion.Control>Email recipients</Accordion.Control>
|
||||
<Accordion.Panel>
|
||||
|
||||
Reference in New Issue
Block a user