diff --git a/src/short-urls/CreateShortUrl.scss b/src/short-urls/CreateShortUrl.scss index e1a8202c..442bc2a5 100644 --- a/src/short-urls/CreateShortUrl.scss +++ b/src/short-urls/CreateShortUrl.scss @@ -6,3 +6,8 @@ display: block; } } + +.create-short-url .form-group:last-child, +.create-short-url p:last-child { + margin-bottom: 0; +} diff --git a/src/short-urls/CreateShortUrl.tsx b/src/short-urls/CreateShortUrl.tsx index d6f65ede..2df2978b 100644 --- a/src/short-urls/CreateShortUrl.tsx +++ b/src/short-urls/CreateShortUrl.tsx @@ -1,6 +1,6 @@ import { isEmpty, pipe, replace, trim } from 'ramda'; import { FC, useState } from 'react'; -import { Button, FormGroup, Input } from 'reactstrap'; +import { Button, Card, CardBody, CardHeader, FormGroup, Input } from 'reactstrap'; import { InputType } from 'reactstrap/lib/Input'; import * as m from 'moment'; import DateInput, { DateInputProps } from '../utils/DateInput'; @@ -101,7 +101,7 @@ const CreateShortUrl = ( const disableShortCodeLength = !versionMatch(currentServerVersion, { minVersion: '2.1.0' }); return ( -
+
-
- {renderOptionalInput('customSlug', 'Custom slug', 'text', { - disabled: hasValue(shortUrlCreation.shortCodeLength), - })} +
+ + Customize the short URL + +

+ Use a custom slug for your marketing campaigns, change the domain or set a specific length for + the auto-generated short code. +

+ {renderOptionalInput('customSlug', 'Custom slug', 'text', { + disabled: hasValue(shortUrlCreation.shortCodeLength), + })} + {renderOptionalInput('shortCodeLength', 'Short code length', 'number', { + min: 4, + disabled: disableShortCodeLength || hasValue(shortUrlCreation.customSlug), + ...disableShortCodeLength && { + title: 'Shlink 2.1.0 or higher is required to be able to provide the short code length', + }, + })} + {!showDomainSelector && renderOptionalInput('domain', 'Domain', 'text', { + disabled: disableDomain, + ...disableDomain && { title: 'Shlink 1.19.0 or higher is required to be able to provide the domain' }, + })} + {showDomainSelector && ( + + setShortUrlCreation({ ...shortUrlCreation, domain })} + /> + + )} +
+
-
- {renderOptionalInput('shortCodeLength', 'Short code length', 'number', { - min: 4, - disabled: disableShortCodeLength || hasValue(shortUrlCreation.customSlug), - ...disableShortCodeLength && { - title: 'Shlink 2.1.0 or higher is required to be able to provide the short code length', - }, - })} -
-
- {!showDomainSelector && renderOptionalInput('domain', 'Domain', 'text', { - disabled: disableDomain, - ...disableDomain && { title: 'Shlink 1.19.0 or higher is required to be able to provide the domain' }, - })} - {showDomainSelector && ( - - setShortUrlCreation({ ...shortUrlCreation, domain })} - /> - - )} + +
+ + Limit access to the short URL + +

Determine when and how many times your short URL can be accessed.

+ {renderOptionalInput('maxVisits', 'Maximum number of visits allowed', 'number', { min: 1 })} + {renderDateInput('validSince', 'Enabled since...', { maxDate: shortUrlCreation.validUntil as m.Moment | undefined })} + {renderDateInput('validUntil', 'Enabled until...', { minDate: shortUrlCreation.validSince as m.Moment | undefined })} +
+
-
-
- {renderOptionalInput('maxVisits', 'Maximum number of visits allowed', 'number', { min: 1 })} -
-
- {renderDateInput('validSince', 'Enabled since...', { maxDate: shortUrlCreation.validUntil as m.Moment | undefined })} -
-
- {renderDateInput('validUntil', 'Enabled until...', { minDate: shortUrlCreation.validSince as m.Moment | undefined })} -
-
- - -
-
- + + Extra validations + +

+ Make sure the long URL is valid, or ensure an existing short URL is returned if it matches all + provided data. +

+ +

Validate URL - -

-
- setShortUrlCreation({ ...shortUrlCreation, findIfExists })} - > - Use existing URL if found - - -
-
-
+

+ + +

+ setShortUrlCreation({ ...shortUrlCreation, findIfExists })} + > + Use existing URL if found + + +

+
+ + )} -
+