mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-09 17:57:26 +03:00
Moved style to the proper scope
This commit is contained in:
parent
f507a3628c
commit
124441238b
4 changed files with 12 additions and 4 deletions
|
@ -59,3 +59,7 @@ body,
|
||||||
.paddingless {
|
.paddingless {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.indivisible {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons';
|
import { faInfoCircle as infoIcon } from '@fortawesome/free-solid-svg-icons';
|
||||||
import { UncontrolledTooltip } from 'reactstrap';
|
import { UncontrolledTooltip } from 'reactstrap';
|
||||||
import { shortUrlType } from '../reducers/shortUrlsList';
|
import { shortUrlType } from '../reducers/shortUrlsList';
|
||||||
|
import './ShortUrlVisitsCount.scss';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
shortUrl: shortUrlType,
|
shortUrl: shortUrlType,
|
||||||
|
@ -18,9 +19,9 @@ const ShortUrlVisitsCount = ({ shortUrl }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<span>
|
<span className="indivisible">
|
||||||
{visitsCount}
|
{visitsCount}
|
||||||
<small id="maxVisitsControl" className="short-urls-row__max-visits-control">
|
<small id="maxVisitsControl" className="short-urls-visits-count__max-visits-control">
|
||||||
{' '}/ {maxVisits}{' '}
|
{' '}/ {maxVisits}{' '}
|
||||||
<sup>
|
<sup>
|
||||||
<FontAwesomeIcon icon={infoIcon} />
|
<FontAwesomeIcon icon={infoIcon} />
|
||||||
|
|
3
src/short-urls/helpers/ShortUrlVisitsCount.scss
Normal file
3
src/short-urls/helpers/ShortUrlVisitsCount.scss
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
.short-urls-visits-count__max-visits-control {
|
||||||
|
cursor: help;
|
||||||
|
}
|
|
@ -17,7 +17,7 @@ describe('<ShortUrlVisitsCount />', () => {
|
||||||
it('just returns visits when no maxVisits is provided', () => {
|
it('just returns visits when no maxVisits is provided', () => {
|
||||||
const visitsCount = 45;
|
const visitsCount = 45;
|
||||||
const wrapper = createWrapper({ visitsCount });
|
const wrapper = createWrapper({ visitsCount });
|
||||||
const maxVisitsHelper = wrapper.find('.short-urls-row__max-visits-control');
|
const maxVisitsHelper = wrapper.find('.short-urls-visits-count__max-visits-control');
|
||||||
const maxVisitsTooltip = wrapper.find(UncontrolledTooltip);
|
const maxVisitsTooltip = wrapper.find(UncontrolledTooltip);
|
||||||
|
|
||||||
expect(wrapper.html()).toEqual(`<span>${visitsCount}</span>`);
|
expect(wrapper.html()).toEqual(`<span>${visitsCount}</span>`);
|
||||||
|
@ -30,7 +30,7 @@ describe('<ShortUrlVisitsCount />', () => {
|
||||||
const maxVisits = 500;
|
const maxVisits = 500;
|
||||||
const meta = { maxVisits };
|
const meta = { maxVisits };
|
||||||
const wrapper = createWrapper({ visitsCount, meta });
|
const wrapper = createWrapper({ visitsCount, meta });
|
||||||
const maxVisitsHelper = wrapper.find('.short-urls-row__max-visits-control');
|
const maxVisitsHelper = wrapper.find('.short-urls-visits-count__max-visits-control');
|
||||||
const maxVisitsTooltip = wrapper.find(UncontrolledTooltip);
|
const maxVisitsTooltip = wrapper.find(UncontrolledTooltip);
|
||||||
|
|
||||||
expect(wrapper.html()).toContain(`/ ${maxVisits}`);
|
expect(wrapper.html()).toContain(`/ ${maxVisits}`);
|
||||||
|
|
Loading…
Reference in a new issue