Updated margin, padding and alignment classes to the new bootstrap 5 approach

This commit is contained in:
Alejandro Celaya 2022-03-05 13:26:28 +01:00
parent ce871fe2a2
commit e5a84b1505
35 changed files with 55 additions and 55 deletions

View file

@ -24,8 +24,8 @@ export const AppUpdateBanner: FC<AppUpdateBannerProps> = ({ isOpen, toggle, forc
<h4 className="mb-4">This app has just been updated!</h4> <h4 className="mb-4">This app has just been updated!</h4>
<p className="mb-0"> <p className="mb-0">
Restart it to enjoy the new features. Restart it to enjoy the new features.
<Button disabled={isUpdating} className="ml-2" color="secondary" size="sm" onClick={update}> <Button disabled={isUpdating} className="ms-2" color="secondary" size="sm" onClick={update}>
{!isUpdating && <>Restart now <FontAwesomeIcon icon={reloadIcon} className="ml-1" /></>} {!isUpdating && <>Restart now <FontAwesomeIcon icon={reloadIcon} className="ms-1" /></>}
{isUpdating && <>Restarting...</>} {isUpdating && <>Restarting...</>}
</Button> </Button>
</p> </p>

View file

@ -46,14 +46,14 @@ const Home = ({ servers }: HomeProps) => {
<div className="p-4 text-center"> <div className="p-4 text-center">
<p className="mb-5">This application will help you manage your Shlink servers.</p> <p className="mb-5">This application will help you manage your Shlink servers.</p>
<p> <p>
<Link to="/server/create" className="btn btn-outline-primary btn-lg mr-2"> <Link to="/server/create" className="btn btn-outline-primary btn-lg me-2">
<FontAwesomeIcon icon={faPlus} /> <span className="ml-1">Add a server</span> <FontAwesomeIcon icon={faPlus} /> <span className="ms-1">Add a server</span>
</Link> </Link>
</p> </p>
<p className="mb-0 mt-5"> <p className="mb-0 mt-5">
<ExternalLink href="https://shlink.io/documentation"> <ExternalLink href="https://shlink.io/documentation">
<small> <small>
<span className="mr-1">Learn more about Shlink</span> <FontAwesomeIcon icon={faExternalLinkAlt} /> <span className="me-1">Learn more about Shlink</span> <FontAwesomeIcon icon={faExternalLinkAlt} />
</small> </small>
</ExternalLink> </ExternalLink>
</p> </p>

View file

@ -29,7 +29,7 @@ const MainHeader = (ServersDropdown: FC) => () => {
</NavbarToggler> </NavbarToggler>
<Collapse navbar isOpen={isOpen}> <Collapse navbar isOpen={isOpen}>
<Nav navbar className="ml-auto"> <Nav navbar className="ms-auto">
<NavItem> <NavItem>
<NavLink tag={Link} to={settingsPath} active={pathname.startsWith(settingsPath)}> <NavLink tag={Link} to={settingsPath} active={pathname.startsWith(settingsPath)}>
<FontAwesomeIcon icon={cogsIcon} />&nbsp; Settings <FontAwesomeIcon icon={cogsIcon} />&nbsp; Settings

View file

@ -63,7 +63,7 @@ export const DomainRow: FC<DomainRowProps> = (
<td className="responsive-table__cell text-lg-center" data-th="Status"> <td className="responsive-table__cell text-lg-center" data-th="Status">
<DomainStatusIcon status={status} /> <DomainStatusIcon status={status} />
</td> </td>
<td className="responsive-table__cell text-right"> <td className="responsive-table__cell text-end">
<span id={!canEditDomain ? 'defaultDomainBtn' : undefined}> <span id={!canEditDomain ? 'defaultDomainBtn' : undefined}>
<Button outline size="sm" disabled={!canEditDomain} onClick={!canEditDomain ? undefined : toggle}> <Button outline size="sm" disabled={!canEditDomain} onClick={!canEditDomain ? undefined : toggle}>
<FontAwesomeIcon fixedWidth icon={!canEditDomain ? forbiddenIcon : editIcon} /> <FontAwesomeIcon fixedWidth icon={!canEditDomain ? forbiddenIcon : editIcon} />

View file

@ -60,7 +60,7 @@ export const DomainSelector = ({ listDomains, value, domainsList, onChange }: Do
onClick={() => onChange(domain)} onClick={() => onChange(domain)}
> >
{domain} {domain}
{isDefault && <span className="float-right text-muted">default</span>} {isDefault && <span className="float-end text-muted">default</span>}
</DropdownItem> </DropdownItem>
))} ))}
<DropdownItem divider /> <DropdownItem divider />

View file

@ -42,20 +42,20 @@ export const EditDomainRedirectsModal: FC<EditDomainRedirectsModalProps> = (
<ModalHeader toggle={toggle}>Edit redirects for <b>{domain.domain}</b></ModalHeader> <ModalHeader toggle={toggle}>Edit redirects for <b>{domain.domain}</b></ModalHeader>
<ModalBody> <ModalBody>
<FormGroup value={baseUrlRedirect} onChange={setBaseUrlRedirect}> <FormGroup value={baseUrlRedirect} onChange={setBaseUrlRedirect}>
<InfoTooltip className="mr-2" placement="bottom"> <InfoTooltip className="me-2" placement="bottom">
Visitors accessing the base url, as in <b>https://{domain.domain}/</b>, will be redirected to this URL. Visitors accessing the base url, as in <b>https://{domain.domain}/</b>, will be redirected to this URL.
</InfoTooltip> </InfoTooltip>
Base URL Base URL
</FormGroup> </FormGroup>
<FormGroup value={regular404Redirect} onChange={setRegular404Redirect}> <FormGroup value={regular404Redirect} onChange={setRegular404Redirect}>
<InfoTooltip className="mr-2" placement="bottom"> <InfoTooltip className="me-2" placement="bottom">
Visitors accessing a url not matching a short URL pattern, as in <b>https://{domain.domain}/???/[...]</b>, Visitors accessing a url not matching a short URL pattern, as in <b>https://{domain.domain}/???/[...]</b>,
will be redirected to this URL. will be redirected to this URL.
</InfoTooltip> </InfoTooltip>
Regular 404 Regular 404
</FormGroup> </FormGroup>
<FormGroup value={invalidShortUrlRedirect} isLast onChange={setInvalidShortUrlRedirect}> <FormGroup value={invalidShortUrlRedirect} isLast onChange={setInvalidShortUrlRedirect}>
<InfoTooltip className="mr-2" placement="bottom"> <InfoTooltip className="me-2" placement="bottom">
Visitors accessing a url matching a short URL pattern, but not matching an existing short code, will be Visitors accessing a url matching a short URL pattern, but not matching an existing short code, will be
redirected to this URL. redirected to this URL.
</InfoTooltip> </InfoTooltip>

View file

@ -61,7 +61,7 @@ const CreateServer = (ImportServersBtn: FC<ImportServersBtnProps>, useStateFlagT
{!hasServers && {!hasServers &&
<ImportServersBtn tooltipPlacement="top" onImport={setServersImported} onImportError={setErrorImporting} />} <ImportServersBtn tooltipPlacement="top" onImport={setServersImported} onImportError={setErrorImporting} />}
{hasServers && <Button outline onClick={goBack}>Cancel</Button>} {hasServers && <Button outline onClick={goBack}>Cancel</Button>}
<Button outline color="primary" className="ml-2">Create server</Button> <Button outline color="primary" className="ms-2">Create server</Button>
</ServerForm> </ServerForm>
{serversImported && <ImportResult type="success" />} {serversImported && <ImportResult type="success" />}

View file

@ -29,7 +29,7 @@ export const EditServer = (ServerError: FC) => withSelectedServer<EditServerProp
initialValues={selectedServer} initialValues={selectedServer}
onSubmit={handleSubmit} onSubmit={handleSubmit}
> >
<Button outline className="mr-2" onClick={goBack}>Cancel</Button> <Button outline className="me-2" onClick={goBack}>Cancel</Button>
<Button outline color="primary">Save</Button> <Button outline color="primary">Save</Button>
</ServerForm> </ServerForm>
</NoMenuLayout> </NoMenuLayout>

View file

@ -45,7 +45,7 @@ export const ManageServers = (
<div className="col-md-6 d-flex d-md-block mb-2 mb-md-0"> <div className="col-md-6 d-flex d-md-block mb-2 mb-md-0">
<ImportServersBtn className="flex-fill" onImportError={setErrorImporting}>Import servers</ImportServersBtn> <ImportServersBtn className="flex-fill" onImportError={setErrorImporting}>Import servers</ImportServersBtn>
{allServers.length > 0 && ( {allServers.length > 0 && (
<Button outline className="ml-2 flex-fill" onClick={async () => serversExporter.exportServers()}> <Button outline className="ms-2 flex-fill" onClick={async () => serversExporter.exportServers()}>
<FontAwesomeIcon icon={exportIcon} fixedWidth /> Export servers <FontAwesomeIcon icon={exportIcon} fixedWidth /> Export servers
</Button> </Button>
)} )}

View file

@ -31,7 +31,7 @@ export const ManageServersRow = (
<Link to={`/server/${server.id}`}>{server.name}</Link> <Link to={`/server/${server.id}`}>{server.name}</Link>
</th> </th>
<td className="responsive-table__cell" data-th="Base URL">{server.url}</td> <td className="responsive-table__cell" data-th="Base URL">{server.url}</td>
<td className="responsive-table__cell text-right"> <td className="responsive-table__cell text-end">
<ManageServersRowDropdown server={server} /> <ManageServersRowDropdown server={server} />
</td> </td>
</tr> </tr>

View file

@ -86,7 +86,7 @@ export const Overview = (
<CardHeader> <CardHeader>
<span className="d-sm-none">Create a short URL</span> <span className="d-sm-none">Create a short URL</span>
<h5 className="d-none d-sm-inline">Create a short URL</h5> <h5 className="d-none d-sm-inline">Create a short URL</h5>
<Link className="float-right" to={`/server/${serverId}/create-short-url`}>Advanced options &raquo;</Link> <Link className="float-end" to={`/server/${serverId}/create-short-url`}>Advanced options &raquo;</Link>
</CardHeader> </CardHeader>
<CardBody> <CardBody>
<CreateShortUrl basicMode /> <CreateShortUrl basicMode />
@ -96,7 +96,7 @@ export const Overview = (
<CardHeader> <CardHeader>
<span className="d-sm-none">Recently created URLs</span> <span className="d-sm-none">Recently created URLs</span>
<h5 className="d-none d-sm-inline">Recently created URLs</h5> <h5 className="d-none d-sm-inline">Recently created URLs</h5>
<Link className="float-right" to={`/server/${serverId}/list-short-urls/1`}>See all &raquo;</Link> <Link className="float-end" to={`/server/${serverId}/list-short-urls/1`}>See all &raquo;</Link>
</CardHeader> </CardHeader>
<CardBody> <CardBody>
<ShortUrlsTable <ShortUrlsTable

View file

@ -17,7 +17,7 @@ const ServersDropdown = ({ servers, selectedServer }: ServersDropdownProps) => {
if (isEmpty(serversList)) { if (isEmpty(serversList)) {
return ( return (
<DropdownItem tag={Link} to="/server/create"> <DropdownItem tag={Link} to="/server/create">
<FontAwesomeIcon icon={plusIcon} /> <span className="ml-1">Add a server</span> <FontAwesomeIcon icon={plusIcon} /> <span className="ms-1">Add a server</span>
</DropdownItem> </DropdownItem>
); );
} }
@ -31,7 +31,7 @@ const ServersDropdown = ({ servers, selectedServer }: ServersDropdownProps) => {
))} ))}
<DropdownItem divider /> <DropdownItem divider />
<DropdownItem tag={Link} to="/manage-servers"> <DropdownItem tag={Link} to="/manage-servers">
<FontAwesomeIcon icon={serverIcon} /> <span className="ml-1">Manage servers</span> <FontAwesomeIcon icon={serverIcon} /> <span className="ms-1">Manage servers</span>
</DropdownItem> </DropdownItem>
</> </>
); );
@ -40,7 +40,7 @@ const ServersDropdown = ({ servers, selectedServer }: ServersDropdownProps) => {
return ( return (
<UncontrolledDropdown nav inNavbar> <UncontrolledDropdown nav inNavbar>
<DropdownToggle nav caret> <DropdownToggle nav caret>
<FontAwesomeIcon icon={serverIcon} /> <span className="ml-1">Servers</span> <FontAwesomeIcon icon={serverIcon} /> <span className="ms-1">Servers</span>
</DropdownToggle> </DropdownToggle>
<DropdownMenu right>{renderServers()}</DropdownMenu> <DropdownMenu right>{renderServers()}</DropdownMenu>
</UncontrolledDropdown> </UncontrolledDropdown>

View file

@ -34,7 +34,7 @@ export const ServerForm: FC<ServerFormProps> = ({ onSubmit, initialValues, child
<FormGroup value={apiKey} onChange={setApiKey}>API key</FormGroup> <FormGroup value={apiKey} onChange={setApiKey}>API key</FormGroup>
</SimpleCard> </SimpleCard>
<div className="text-right">{children}</div> <div className="text-end">{children}</div>
</form> </form>
); );
}; };

View file

@ -88,7 +88,7 @@ export const EditShortUrl = (ShortUrlForm: FC<ShortUrlFormProps>) => ({
<header className="mb-3"> <header className="mb-3">
<Card body> <Card body>
<h2 className="d-sm-flex justify-content-between align-items-center mb-0"> <h2 className="d-sm-flex justify-content-between align-items-center mb-0">
<Button color="link" size="lg" className="p-0 mr-3" onClick={goBack}> <Button color="link" size="lg" className="p-0 me-3" onClick={goBack}>
<FontAwesomeIcon icon={faArrowLeft} /> <FontAwesomeIcon icon={faArrowLeft} />
</Button> </Button>
<span className="text-center"> <span className="text-center">

View file

@ -189,7 +189,7 @@ export const ShortUrlForm = (
<p> <p>
<Checkbox <Checkbox
inline inline
className="mr-2" className="me-2"
checked={shortUrlData.findIfExists} checked={shortUrlData.findIfExists}
onChange={(findIfExists) => setShortUrlData({ ...shortUrlData, findIfExists })} onChange={(findIfExists) => setShortUrlData({ ...shortUrlData, findIfExists })}
> >

View file

@ -67,7 +67,7 @@ const ShortUrlsFilteringBar = (colorGenerator: ColorGenerator) => ({ selectedSer
{selectedTags.length > 0 && ( {selectedTags.length > 0 && (
<h4 className="mt-3"> <h4 className="mt-3">
{canChangeTagsMode && selectedTags.length > 1 && ( {canChangeTagsMode && selectedTags.length > 1 && (
<div className="float-right ml-2 mt-1"> <div className="float-end ms-2 mt-1">
<TooltipToggleSwitch <TooltipToggleSwitch
checked={tagsMode === 'all'} checked={tagsMode === 'all'}
tooltip={{ placement: 'left' }} tooltip={{ placement: 'left' }}
@ -77,7 +77,7 @@ const ShortUrlsFilteringBar = (colorGenerator: ColorGenerator) => ({ selectedSer
</TooltipToggleSwitch> </TooltipToggleSwitch>
</div> </div>
)} )}
<FontAwesomeIcon icon={tagsIcon} className="short-urls-filtering-bar__tags-icon mr-1" /> <FontAwesomeIcon icon={tagsIcon} className="short-urls-filtering-bar__tags-icon me-1" />
{selectedTags.map((tag) => {selectedTags.map((tag) =>
<Tag colorGenerator={colorGenerator} key={tag} text={tag} clearable onClose={() => removeTag(tag)} />)} <Tag colorGenerator={colorGenerator} key={tag} text={tag} clearable onClose={() => removeTag(tag)} />)}
</h4> </h4>

View file

@ -28,7 +28,7 @@ const CreateShortUrlResult = (useStateFlagTimeout: StateFlagTimeout) => (
if (error) { if (error) {
return ( return (
<Result type="error" className="mt-3"> <Result type="error" className="mt-3">
{canBeClosed && <FontAwesomeIcon icon={closeIcon} className="float-right pointer" onClick={resetCreateShortUrl} />} {canBeClosed && <FontAwesomeIcon icon={closeIcon} className="float-end pointer" onClick={resetCreateShortUrl} />}
<ShlinkApiError errorData={errorData} fallbackMessage="An error occurred while creating the URL :(" /> <ShlinkApiError errorData={errorData} fallbackMessage="An error occurred while creating the URL :(" />
</Result> </Result>
); );
@ -42,7 +42,7 @@ const CreateShortUrlResult = (useStateFlagTimeout: StateFlagTimeout) => (
return ( return (
<Result type="success" className="mt-3"> <Result type="success" className="mt-3">
{canBeClosed && <FontAwesomeIcon icon={closeIcon} className="float-right pointer" onClick={resetCreateShortUrl} />} {canBeClosed && <FontAwesomeIcon icon={closeIcon} className="float-end pointer" onClick={resetCreateShortUrl} />}
<b>Great!</b> The short URL is <b>{shortUrl}</b> <b>Great!</b> The short URL is <b>{shortUrl}</b>
<CopyToClipboard text={shortUrl} onCopy={setShowCopyTooltip}> <CopyToClipboard text={shortUrl} onCopy={setShowCopyTooltip}>

View file

@ -106,7 +106,7 @@ const QrCodeModal = (imageDownloader: ImageDownloader, ForServerVersion: FC<Vers
color="primary" color="primary"
onClick={async () => imageDownloader.saveImage(qrCodeUrl, `${shortCode}-qr-code.${format}`)} onClick={async () => imageDownloader.saveImage(qrCodeUrl, `${shortCode}-qr-code.${format}`)}
> >
Download <FontAwesomeIcon icon={downloadIcon} className="ml-1" /> Download <FontAwesomeIcon icon={downloadIcon} className="ms-1" />
</Button> </Button>
</div> </div>
</ForServerVersion> </ForServerVersion>

View file

@ -12,7 +12,7 @@ export const ShortUrlFormCheckboxGroup: FC<ShortUrlFormCheckboxGroupProps> = (
{ children, infoTooltip, checked, onChange }, { children, infoTooltip, checked, onChange },
) => ( ) => (
<p> <p>
<Checkbox inline checked={checked} className={infoTooltip ? 'mr-2' : ''} onChange={onChange}> <Checkbox inline checked={checked} className={infoTooltip ? 'me-2' : ''} onChange={onChange}>
{children} {children}
</Checkbox> </Checkbox>
{infoTooltip && <InfoTooltip placement="right">{infoTooltip}</InfoTooltip>} {infoTooltip && <InfoTooltip placement="right">{infoTooltip}</InfoTooltip>}

View file

@ -64,14 +64,14 @@ const TagCard = (
to={`/server/${serverId}/list-short-urls/1?tags=${encodeURIComponent(tag.tag)}`} to={`/server/${serverId}/list-short-urls/1?tags=${encodeURIComponent(tag.tag)}`}
className="btn btn-outline-secondary btn-block d-flex justify-content-between align-items-center mb-1" className="btn btn-outline-secondary btn-block d-flex justify-content-between align-items-center mb-1"
> >
<span className="text-ellipsis"><FontAwesomeIcon icon={faLink} className="mr-2" />Short URLs</span> <span className="text-ellipsis"><FontAwesomeIcon icon={faLink} className="me-2" />Short URLs</span>
<b>{prettify(tag.shortUrls)}</b> <b>{prettify(tag.shortUrls)}</b>
</Link> </Link>
<Link <Link
to={`/server/${serverId}/tag/${tag.tag}/visits`} to={`/server/${serverId}/tag/${tag.tag}/visits`}
className="btn btn-outline-secondary btn-block d-flex justify-content-between align-items-center" className="btn btn-outline-secondary btn-block d-flex justify-content-between align-items-center"
> >
<span className="text-ellipsis"><FontAwesomeIcon icon={faEye} className="mr-2" />Visits</span> <span className="text-ellipsis"><FontAwesomeIcon icon={faEye} className="me-2" />Visits</span>
<b>{prettify(tag.visits)}</b> <b>{prettify(tag.visits)}</b>
</Link> </Link>
</CardBody> </CardBody>

View file

@ -14,10 +14,10 @@ interface TagsModeDropdownProps {
export const TagsModeDropdown: FC<TagsModeDropdownProps> = ({ mode, onChange, renderTitle }) => ( export const TagsModeDropdown: FC<TagsModeDropdownProps> = ({ mode, onChange, renderTitle }) => (
<DropdownBtn text={renderTitle?.(mode) ?? `Display mode: ${mode}`}> <DropdownBtn text={renderTitle?.(mode) ?? `Display mode: ${mode}`}>
<DropdownItem active={mode === 'cards'} onClick={() => onChange('cards')}> <DropdownItem active={mode === 'cards'} onClick={() => onChange('cards')}>
<FontAwesomeIcon icon={cardsIcon} fixedWidth className="mr-1" /> Cards <FontAwesomeIcon icon={cardsIcon} fixedWidth className="me-1" /> Cards
</DropdownItem> </DropdownItem>
<DropdownItem active={mode === 'list'} onClick={() => onChange('list')}> <DropdownItem active={mode === 'list'} onClick={() => onChange('list')}>
<FontAwesomeIcon icon={listIcon} fixedWidth className="mr-1" /> List <FontAwesomeIcon icon={listIcon} fixedWidth className="me-1" /> List
</DropdownItem> </DropdownItem>
</DropdownBtn> </DropdownBtn>
); );

View file

@ -44,10 +44,10 @@ export const TagsTableRow = (
<td className="responsive-table__cell text-lg-right"> <td className="responsive-table__cell text-lg-right">
<DropdownBtnMenu toggle={toggleDropdown} isOpen={isDropdownOpen}> <DropdownBtnMenu toggle={toggleDropdown} isOpen={isDropdownOpen}>
<DropdownItem onClick={toggleEdit}> <DropdownItem onClick={toggleEdit}>
<FontAwesomeIcon icon={editIcon} fixedWidth className="mr-1" /> Edit <FontAwesomeIcon icon={editIcon} fixedWidth className="me-1" /> Edit
</DropdownItem> </DropdownItem>
<DropdownItem onClick={toggleDelete}> <DropdownItem onClick={toggleDelete}>
<FontAwesomeIcon icon={deleteIcon} fixedWidth className="mr-1" /> Delete <FontAwesomeIcon icon={deleteIcon} fixedWidth className="me-1" /> Delete
</DropdownItem> </DropdownItem>
</DropdownBtnMenu> </DropdownBtnMenu>
</td> </td>

View file

@ -11,6 +11,6 @@ interface CopyToClipboardIconProps {
export const CopyToClipboardIcon: FC<CopyToClipboardIconProps> = ({ text, onCopy }) => ( export const CopyToClipboardIcon: FC<CopyToClipboardIconProps> = ({ text, onCopy }) => (
<CopyToClipboard text={text} onCopy={onCopy}> <CopyToClipboard text={text} onCopy={onCopy}>
<FontAwesomeIcon icon={copyIcon} className="ml-2 copy-to-clipboard-icon" /> <FontAwesomeIcon icon={copyIcon} className="ms-2 copy-to-clipboard-icon" />
</CopyToClipboard> </CopyToClipboard>
); );

View file

@ -42,7 +42,7 @@ const Message: FC<MessageProps> = ({ className, children, loading = false, type
<Card className={getClassForType(type)} body> <Card className={getClassForType(type)} body>
<h3 className={classNames('text-center mb-0', getTextClassForType(type))}> <h3 className={classNames('text-center mb-0', getTextClassForType(type))}>
{loading && <FontAwesomeIcon icon={preloader} spin />} {loading && <FontAwesomeIcon icon={preloader} spin />}
{loading && <span className="ml-2">{children ?? 'Loading...'}</span>} {loading && <span className="ms-2">{children ?? 'Loading...'}</span>}
{!loading && children} {!loading && children}
</h3> </h3>
</Card> </Card>

View file

@ -9,7 +9,7 @@ interface TableOrderIconProps<T> {
} }
export function TableOrderIcon<T extends string = string>( export function TableOrderIcon<T extends string = string>(
{ currentOrder, field, className = 'ml-1' }: TableOrderIconProps<T>, { currentOrder, field, className = 'ms-1' }: TableOrderIconProps<T>,
) { ) {
if (!currentOrder.dir || currentOrder.field !== field) { if (!currentOrder.dir || currentOrder.field !== field) {
return null; return null;

View file

@ -15,7 +15,7 @@ const TagVisitsHeader = ({ tagVisits, goBack, colorGenerator }: TagVisitsHeaderP
const visitsStatsTitle = ( const visitsStatsTitle = (
<span className="d-flex align-items-center justify-content-center"> <span className="d-flex align-items-center justify-content-center">
<span className="mr-2">Visits for</span> <span className="me-2">Visits for</span>
<Tag text={tag} colorGenerator={colorGenerator} /> <Tag text={tag} colorGenerator={colorGenerator} />
</span> </span>
); );

View file

@ -17,13 +17,13 @@ const VisitsHeader: FC<VisitsHeaderProps> = ({ visits, goBack, shortUrl, childre
<header> <header>
<Card body> <Card body>
<h2 className="d-flex justify-content-between align-items-center mb-0"> <h2 className="d-flex justify-content-between align-items-center mb-0">
<Button color="link" size="lg" className="p-0 mr-3" onClick={goBack}> <Button color="link" size="lg" className="p-0 me-3" onClick={goBack}>
<FontAwesomeIcon icon={faArrowLeft} /> <FontAwesomeIcon icon={faArrowLeft} />
</Button> </Button>
<span className="text-center d-none d-sm-block"> <span className="text-center d-none d-sm-block">
<small>{title}</small> <small>{title}</small>
</span> </span>
<span className="badge badge-main ml-3"> <span className="badge badge-main ms-3">
Visits:{' '} Visits:{' '}
<ShortUrlVisitsCount visitsCount={visits.length} shortUrl={shortUrl} /> <ShortUrlVisitsCount visitsCount={visits.length} shortUrl={shortUrl} />
</span> </span>

View file

@ -147,7 +147,7 @@ const VisitsStats: FC<VisitsStatsProps> = ({
{Object.values(sections).map(({ title, icon, subPath }, index) => ( {Object.values(sections).map(({ title, icon, subPath }, index) => (
<NavPillItem key={index} to={buildSectionUrl(subPath)} replace> <NavPillItem key={index} to={buildSectionUrl(subPath)} replace>
<FontAwesomeIcon icon={icon} /> <FontAwesomeIcon icon={icon} />
<span className="ml-2 d-none d-sm-inline">{title}</span> <span className="ms-2 d-none d-sm-inline">{title}</span>
</NavPillItem> </NavPillItem>
))} ))}
</NavPills> </NavPills>
@ -289,7 +289,7 @@ const VisitsStats: FC<VisitsStatsProps> = ({
/> />
</div> </div>
<VisitsFilterDropdown <VisitsFilterDropdown
className="ml-0 ml-md-2 mt-3 mt-md-0" className="ms-0 ms-md-2 mt-3 mt-md-0"
isOrphanVisits={isOrphanVisits} isOrphanVisits={isOrphanVisits}
botsSupported={botsSupported} botsSupported={botsSupported}
selected={visitsFilter} selected={visitsFilter}
@ -303,7 +303,7 @@ const VisitsStats: FC<VisitsStatsProps> = ({
<Button <Button
outline outline
disabled={highlightedVisits.length === 0} disabled={highlightedVisits.length === 0}
className="btn-md-block mr-2" className="btn-md-block me-2"
onClick={() => setSelectedVisits([])} onClick={() => setSelectedVisits([])}
> >
Clear selection {highlightedVisits.length > 0 && <>({prettify(highlightedVisits.length)})</>} Clear selection {highlightedVisits.length > 0 && <>({prettify(highlightedVisits.length)})</>}

View file

@ -232,7 +232,7 @@ const LineChartCard = (
<Card> <Card>
<CardHeader> <CardHeader>
{title} {title}
<div className="float-right"> <div className="float-end">
<UncontrolledDropdown> <UncontrolledDropdown>
<DropdownToggle caret color="link" className="btn-sm p-0"> <DropdownToggle caret color="link" className="btn-sm p-0">
Group by Group by
@ -246,7 +246,7 @@ const LineChartCard = (
</DropdownMenu> </DropdownMenu>
</UncontrolledDropdown> </UncontrolledDropdown>
</div> </div>
<div className="float-right mr-2"> <div className="float-end me-2">
<ToggleSwitch checked={skipNoVisits} onChange={toggleSkipNoVisits}> <ToggleSwitch checked={skipNoVisits} onChange={toggleSkipNoVisits}>
<small>Skip dates with no visits</small> <small>Skip dates with no visits</small>
</ToggleSwitch> </ToggleSwitch>

View file

@ -95,7 +95,7 @@ export const SortableBarChartCard: FC<SortableBarChartCardProps> = ({
const computeTitle = () => ( const computeTitle = () => (
<> <>
{title} {title}
<div className="float-right"> <div className="float-end">
<OrderingDropdown <OrderingDropdown
isButton={false} isButton={false}
right right
@ -108,9 +108,9 @@ export const SortableBarChartCard: FC<SortableBarChartCardProps> = ({
/> />
</div> </div>
{withPagination && Object.keys(stats).length > 50 && ( {withPagination && Object.keys(stats).length > 50 && (
<div className="float-right"> <div className="float-end">
<PaginationDropdown <PaginationDropdown
toggleClassName="btn-sm p-0 mr-3" toggleClassName="btn-sm p-0 me-3"
ranges={[ 50, 100, 200, 500 ]} ranges={[ 50, 100, 200, 500 ]}
value={itemsPerPage} value={itemsPerPage}
setValue={(itemsPerPage) => { setValue={(itemsPerPage) => {
@ -121,7 +121,7 @@ export const SortableBarChartCard: FC<SortableBarChartCardProps> = ({
</div> </div>
)} )}
{extraHeaderContent && ( {extraHeaderContent && (
<div className="float-right"> <div className="float-end">
{extraHeaderContent(pagination ? activeCities : undefined)} {extraHeaderContent(pagination ? activeCities : undefined)}
</div> </div>
)} )}

View file

@ -26,7 +26,7 @@ export const VisitsFilterDropdown = (
const onBotsClick = () => onChange({ ...selected, excludeBots: !selected?.excludeBots }); const onBotsClick = () => onChange({ ...selected, excludeBots: !selected?.excludeBots });
return ( return (
<DropdownBtn text="Filters" dropdownClassName={className} className="mr-3" right minWidth={250}> <DropdownBtn text="Filters" dropdownClassName={className} className="me-3" right minWidth={250}>
{botsSupported && ( {botsSupported && (
<> <>
<DropdownItem header>Bots:</DropdownItem> <DropdownItem header>Bots:</DropdownItem>

View file

@ -54,7 +54,7 @@ describe('<DomainSelector />', () => {
}); });
it.each([ it.each([
[ 0, 'default.com<span class="float-right text-muted">default</span>' ], [ 0, 'default.com<span class="float-end text-muted">default</span>' ],
[ 1, 'foo.com' ], [ 1, 'foo.com' ],
[ 2, 'bar.com' ], [ 2, 'bar.com' ],
])('shows expected content on every item', (index, expectedContent) => { ])('shows expected content on every item', (index, expectedContent) => {

View file

@ -6,7 +6,7 @@ import { InfoTooltip } from '../../../src/utils/InfoTooltip';
describe('<ShortUrlFormCheckboxGroup />', () => { describe('<ShortUrlFormCheckboxGroup />', () => {
it.each([ it.each([
[ undefined, '', 0 ], [ undefined, '', 0 ],
[ 'This is the tooltip', 'mr-2', 1 ], [ 'This is the tooltip', 'me-2', 1 ],
])('renders tooltip only when provided', (infoTooltip, expectedClassName, expectedAmountOfTooltips) => { ])('renders tooltip only when provided', (infoTooltip, expectedClassName, expectedAmountOfTooltips) => {
const wrapper = shallow(<ShortUrlFormCheckboxGroup infoTooltip={infoTooltip} />); const wrapper = shallow(<ShortUrlFormCheckboxGroup infoTooltip={infoTooltip} />);
const checkbox = wrapper.find(Checkbox); const checkbox = wrapper.find(Checkbox);

View file

@ -22,6 +22,6 @@ describe('<CopyToClipboardIcon />', () => {
expect(copyToClipboard.prop('onCopy')).toEqual(onCopy); expect(copyToClipboard.prop('onCopy')).toEqual(onCopy);
expect(icon).toHaveLength(1); expect(icon).toHaveLength(1);
expect(icon.prop('icon')).toEqual(copyIcon); expect(icon.prop('icon')).toEqual(copyIcon);
expect(icon.prop('className')).toEqual('ml-2 copy-to-clipboard-icon'); expect(icon.prop('className')).toEqual('ms-2 copy-to-clipboard-icon');
}); });
}); });

View file

@ -36,7 +36,7 @@ describe('<TableOrderIcon />', () => {
}); });
it.each([ it.each([
[ undefined, 'ml-1' ], [ undefined, 'ms-1' ],
[ 'foo', 'foo' ], [ 'foo', 'foo' ],
[ 'bar', 'bar' ], [ 'bar', 'bar' ],
])('renders expected classname', (className, expectedClassName) => { ])('renders expected classname', (className, expectedClassName) => {