* {
+ margin: 5px;
+}
+
+.emotion-8 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
-
contributors
-
-
+
+
-
+
`;
exports[`test Developers should render the component for maintainers with items 1`] = `
+.emotion-0 {
+ font-weight: 700;
+ margin-bottom: 10px;
+ text-transform: capitalize;
+}
+
+.emotion-12 {
+ margin: 10px 0 10px 0;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-wrap: wrap;
+ -ms-flex-wrap: wrap;
+ flex-wrap: wrap;
+}
+
+.emotion-12 > * {
+ margin: 5px;
+}
+
+.emotion-8 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
-
maintainers
-
-
+
+
-
+
`;
diff --git a/src/components/Developers/styles.ts b/src/components/Developers/styles.ts
index 15ab694..369e4d9 100644
--- a/src/components/Developers/styles.ts
+++ b/src/components/Developers/styles.ts
@@ -1,9 +1,9 @@
-import styled from 'react-emotion';
+import styled from '@emotion/styled';
-import colors from '../../utils/styles/colors';
import { fontWeight } from '../../utils/styles/sizes';
import Text from '../../muiComponents/Text';
import FloatingActionButton from '../../muiComponents/FloatingActionButton';
+import { Theme } from '../../design-tokens/theme';
export const Details = styled('span')({
display: 'flex',
@@ -26,7 +26,7 @@ export const StyledText = styled(Text)({
textTransform: 'capitalize',
});
-export const Fab = styled(FloatingActionButton)({
- backgroundColor: colors.primary,
- color: colors.white,
-});
+export const Fab = styled(FloatingActionButton)<{ theme?: Theme }>(props => ({
+ backgroundColor: props.theme && props.theme.palette.primary.main,
+ color: props.theme && props.theme.palette.white,
+}));
diff --git a/src/components/Dist/Dist.test.tsx b/src/components/Dist/Dist.test.tsx
index 6a55b11..565f895 100644
--- a/src/components/Dist/Dist.test.tsx
+++ b/src/components/Dist/Dist.test.tsx
@@ -1,6 +1,6 @@
import React from 'react';
-import { mount } from 'enzyme';
+import { mount } from '../../utils/test-enzyme';
import { DetailContext } from '../../pages/Version';
import Dist from './Dist';
diff --git a/src/components/Dist/__snapshots__/Dist.test.tsx.snap b/src/components/Dist/__snapshots__/Dist.test.tsx.snap
index 6ead806..d2b3ab2 100644
--- a/src/components/Dist/__snapshots__/Dist.test.tsx.snap
+++ b/src/components/Dist/__snapshots__/Dist.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`
component should render the component in default state 1`] = `"
"`;
+exports[`
component should render the component in default state 1`] = `"
"`;
-exports[`
component should render the component with license as object 1`] = `"
"`;
+exports[`
component should render the component with license as object 1`] = `"
"`;
-exports[`
component should render the component with license as string 1`] = `"
"`;
+exports[`
component should render the component with license as string 1`] = `"
"`;
diff --git a/src/components/Dist/styles.ts b/src/components/Dist/styles.ts
index 30da4e7..f73de93 100644
--- a/src/components/Dist/styles.ts
+++ b/src/components/Dist/styles.ts
@@ -1,6 +1,6 @@
-import styled from 'react-emotion';
+import styled from '@emotion/styled';
-import colors from '../../utils/styles/colors';
+import { Theme } from '../../design-tokens/theme';
import { fontWeight } from '../../utils/styles/sizes';
import ListItem from '../../muiComponents/ListItem';
import Text from '../../muiComponents/Text';
@@ -18,11 +18,11 @@ export const DistListItem = styled(ListItem)({
});
export const DistChips = styled(Chip)({
- marginRight: '5px',
+ marginRight: 5,
textTransform: 'capitalize',
});
-export const DownloadButton = styled(FloatingActionButton)({
- backgroundColor: colors.primary,
- color: colors.white,
-});
+export const DownloadButton = styled(FloatingActionButton)<{ theme?: Theme }>(props => ({
+ backgroundColor: props.theme && props.theme.palette.primary.main,
+ color: props.theme && props.theme.palette.white,
+}));
diff --git a/src/components/Engines/Engines.test.tsx b/src/components/Engines/Engines.test.tsx
index 1521549..369938b 100644
--- a/src/components/Engines/Engines.test.tsx
+++ b/src/components/Engines/Engines.test.tsx
@@ -1,6 +1,6 @@
import React from 'react';
-import { mount } from 'enzyme';
+import { mount } from '../../utils/test-enzyme';
import { DetailContext } from '../../pages/Version';
import { PackageMetaInterface } from '../../../types/packageMeta';
diff --git a/src/components/Engines/__snapshots__/Engines.test.tsx.snap b/src/components/Engines/__snapshots__/Engines.test.tsx.snap
index eceee05..06a6f3f 100644
--- a/src/components/Engines/__snapshots__/Engines.test.tsx.snap
+++ b/src/components/Engines/__snapshots__/Engines.test.tsx.snap
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`
component should render the component in default state 1`] = `"
"`;
+exports[`
component should render the component in default state 1`] = `"
"`;
diff --git a/src/components/Engines/styles.ts b/src/components/Engines/styles.ts
index f44af79..8bdd9d1 100644
--- a/src/components/Engines/styles.ts
+++ b/src/components/Engines/styles.ts
@@ -1,4 +1,4 @@
-import styled from 'react-emotion';
+import styled from '@emotion/styled';
import { fontWeight } from '../../utils/styles/sizes';
import ListItem from '../../muiComponents/ListItem';
diff --git a/src/components/Footer/Footer.test.tsx b/src/components/Footer/Footer.test.tsx
index bbf01c6..3abaec1 100644
--- a/src/components/Footer/Footer.test.tsx
+++ b/src/components/Footer/Footer.test.tsx
@@ -1,21 +1,20 @@
import React from 'react';
-import { mount, ReactWrapper } from 'enzyme';
+
+import { render } from '../../utils/test-react-testing-library';
import Footer from './Footer';
-jest.mock('../../../package.json', () => ({
- version: '4.0.0-alpha.3',
-}));
-
describe('
component', () => {
- let wrapper: ReactWrapper;
- beforeEach(() => {
+ beforeAll(() => {
window.VERDACCIO_VERSION = 'v.1.0.0';
- wrapper = mount(
);
+ });
+
+ afterAll(() => {
delete window.VERDACCIO_VERSION;
});
test('should load the initial state of Footer component', () => {
- expect(wrapper.html()).toMatchSnapshot();
+ const { container } = render(
);
+ expect(container.firstChild).toMatchSnapshot();
});
});
diff --git a/src/components/Footer/__snapshots__/Footer.test.tsx.snap b/src/components/Footer/__snapshots__/Footer.test.tsx.snap
index d0b2e36..4583d1a 100644
--- a/src/components/Footer/__snapshots__/Footer.test.tsx.snap
+++ b/src/components/Footer/__snapshots__/Footer.test.tsx.snap
@@ -1,3 +1,274 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`
component should load the initial state of Footer component 1`] = `"
Made with♥on
Powered by
/ v.1.0.0
"`;
+exports[`
component should load the initial state of Footer component 1`] = `
+.emotion-38 {
+ background: #f9f9f9;
+ border-top: 1px solid #e3e3e3;
+ color: #999999;
+ font-size: 14px;
+ padding: 20px;
+}
+
+.emotion-36 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ -webkit-box-pack: end;
+ -webkit-justify-content: flex-end;
+ -ms-flex-pack: end;
+ justify-content: flex-end;
+ width: 100%;
+}
+
+@media (min-width:768px) {
+ .emotion-36 {
+ min-width: 400px;
+ max-width: 800px;
+ margin: auto;
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+ }
+}
+
+@media (min-width:1024px) {
+ .emotion-36 {
+ max-width: 1240px;
+ }
+}
+
+.emotion-27 {
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ display: none;
+}
+
+@media (min-width:768px) {
+ .emotion-27 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ }
+}
+
+.emotion-0 {
+ color: #e25555;
+ padding: 0 5px;
+}
+
+.emotion-25 {
+ position: relative;
+ height: 18px;
+}
+
+.emotion-25:hover .emotion-24 {
+ visibility: visible;
+}
+
+.emotion-3 {
+ box-sizing: initial;
+ display: inline-block;
+ cursor: default;
+ width: 18px;
+ height: 18px;
+ padding: 0 10px;
+}
+
+.emotion-23 {
+ position: absolute;
+ background: #d3dddd;
+ padding: 1px 4px;
+ border-radius: 3px;
+ height: 20px;
+ display: -webkit-inline-box;
+ display: -webkit-inline-flex;
+ display: -ms-inline-flexbox;
+ display: inline-flex;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ visibility: hidden;
+ top: -2px;
+}
+
+.emotion-23:before {
+ content: '';
+ position: absolute;
+ top: 29%;
+ left: -4px;
+ margin-left: -5px;
+ border: 5px solid;
+ border-color: #d3dddd transparent transparent transparent;
+ -webkit-transform: rotate(90deg);
+ -ms-transform: rotate(90deg);
+ transform: rotate(90deg);
+}
+
+.emotion-6 {
+ box-sizing: initial;
+ display: inline-block;
+ cursor: default;
+ width: 18px;
+ height: 18px;
+ padding: 0 5px;
+}
+
+.emotion-34 {
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ display: none;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+}
+
+@media (min-width:768px) {
+ .emotion-34 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ }
+}
+
+.emotion-32 {
+ box-sizing: initial;
+ display: inline-block;
+ cursor: pointer;
+ width: 18px;
+ height: 18px;
+ padding: 0 5px;
+}
+
+.emotion-29 {
+ width: 100%;
+ height: auto;
+}
+
+
+
+
+ Made with
+
+ ♥
+
+ on
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Powered by
+
+
+
+ / v.1.0.0
+
+
+
+`;
diff --git a/src/components/Footer/styles.ts b/src/components/Footer/styles.ts
index 3cff8b3..c001a5c 100644
--- a/src/components/Footer/styles.ts
+++ b/src/components/Footer/styles.ts
@@ -1,110 +1,88 @@
-import styled, { css } from 'react-emotion';
+import styled from '@emotion/styled';
-import mq from '../../utils/styles/media';
+import { breakpoints } from '../../utils/styles/media';
import Icon from '../Icon/Icon';
-import colors from '../../utils/styles/colors';
+import { Theme } from '../../design-tokens/theme';
-export const Wrapper = styled('div')({
- '&&': {
- background: colors.snow,
- borderTop: `1px solid ${colors.greyGainsboro}`,
- color: colors.nobel01,
- fontSize: '14px',
- padding: '20px',
+export const Wrapper = styled('div')<{ theme?: Theme }>(props => ({
+ background: props.theme && props.theme.palette.snow,
+ borderTop: `1px solid ${props.theme && props.theme.palette.greyGainsboro}`,
+ color: props.theme && props.theme.palette.nobel01,
+ fontSize: '14px',
+ padding: '20px',
+}));
+
+export const Inner = styled('div')({
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'flex-end',
+ width: '100%',
+ [`@media (min-width: ${breakpoints.medium}px)`]: {
+ minWidth: 400,
+ maxWidth: 800,
+ margin: 'auto',
+ justifyContent: 'space-between',
+ },
+ [`@media (min-width: ${breakpoints.large}px)`]: {
+ maxWidth: 1240,
},
});
-export const Inner = styled('div')`
- && {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- width: 100%;
- ${() => {
- return mq.medium(css`
- min-width: 400px;
- max-width: 800px;
- margin: auto;
- justify-content: space-between;
- `);
- }};
- ${() => {
- return mq.large(css`
- max-width: 1240px;
- `);
- }};
- }
-`;
-
-export const Left = styled('div')`
- && {
- align-items: center;
- display: none;
- ${() => {
- return mq.medium(css`
- display: flex;
- `);
- }};
- }
-`;
-
-export const Right = styled(Left)({
- '&&': {
+export const Left = styled('div')({
+ alignItems: 'center',
+ display: 'none',
+ [`@media (min-width: ${breakpoints.medium}px)`]: {
display: 'flex',
},
});
-export const ToolTip = styled('span')({
- '&&': {
- position: 'relative',
- height: '18px',
- },
+export const Right = styled(Left)({
+ display: 'flex',
});
export const Earth = styled(Icon)({
- '&&': {
- padding: '0 10px',
+ padding: '0 10px',
+});
+
+export const Flags = styled('span')<{ theme?: Theme }>(props => ({
+ position: 'absolute',
+ background: props.theme && props.theme.palette.greyAthens,
+ padding: '1px 4px',
+ borderRadius: 3,
+ height: 20,
+ display: 'inline-flex',
+ alignItems: 'center',
+ visibility: 'hidden',
+ top: -2,
+ ':before': {
+ content: "''",
+ position: 'absolute',
+ top: '29%',
+ left: -4,
+ marginLeft: -5,
+ border: '5px solid',
+ borderColor: `${props.theme && props.theme.palette.greyAthens} transparent transparent transparent`,
+ transform: 'rotate(90deg)',
+ },
+}));
+
+export const ToolTip = styled('span')({
+ position: 'relative',
+ height: '18px',
+ ':hover': {
+ [`${Flags}`]: {
+ visibility: 'visible',
+ },
},
});
-export const Flags = styled('span')`
- && {
- position: absolute;
- background: ${colors.greyAthens};
- padding: 1px 4px;
- border-radius: 3px;
- height: 20px;
- display: inline-flex;
- align-items: center;
- visibility: hidden;
- top: -2px;
- :before {
- content: '';
- position: absolute;
- top: 29%;
- left: -4px;
- margin-left: -5px;
- border: 5px solid;
- border-color: ${colors.greyAthens} transparent transparent transparent;
- transform: rotate(90deg);
- }
- ${/* sc-selector */ ToolTip}:hover & {
- visibility: visible;
- }
- }
-`;
-
-export const Love = styled('span')({
- '&&': {
- color: colors.love,
- padding: '0 5px',
- },
-});
+export const Love = styled('span')<{ theme?: Theme }>(props => ({
+ color: props.theme && props.theme.palette.love,
+ padding: '0 5px',
+}));
export const Flag = styled(Icon)({
- '&&': {
- padding: '0 5px',
- },
+ padding: '0 5px',
});
export const Logo = Flag;
diff --git a/src/components/Header/Header.test.tsx b/src/components/Header/Header.test.tsx
index 3e936e7..4654386 100644
--- a/src/components/Header/Header.test.tsx
+++ b/src/components/Header/Header.test.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
-import { render, fireEvent, waitForElementToBeRemoved, waitForElement } from '@testing-library/react';
+
+import { render, fireEvent, waitForElementToBeRemoved, waitForElement } from '../../utils/test-react-testing-library';
import Header from './Header';
diff --git a/src/components/Header/HeaderLeft.tsx b/src/components/Header/HeaderLeft.tsx
index 1b92079..d58a2b1 100644
--- a/src/components/Header/HeaderLeft.tsx
+++ b/src/components/Header/HeaderLeft.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { css } from 'emotion';
+import styled from '@emotion/styled';
import { Link } from 'react-router-dom';
import Search from '../Search/';
@@ -12,15 +12,15 @@ interface Props {
logo?: string;
}
+const StyledLink = styled(Link)({
+ marginRight: '1em',
+});
+
const HeaderLeft: React.FC
= ({ withoutSearch = false, logo }) => (
-
+
-
+
{!withoutSearch && (
diff --git a/src/components/Header/__snapshots__/Header.test.tsx.snap b/src/components/Header/__snapshots__/Header.test.tsx.snap
index 224925c..b606747 100644
--- a/src/components/Header/__snapshots__/Header.test.tsx.snap
+++ b/src/components/Header/__snapshots__/Header.test.tsx.snap
@@ -1,28 +1,166 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[` component with logged in state should load the component in logged in state 1`] = `
+.emotion-24 {
+ background-color: #4b5e40;
+ min-height: 60px;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+}
+
+@media (min-width:768px) {
+ .emotion-24 .emotion-13 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ }
+
+ .emotion-24 .emotion-17 {
+ display: none;
+ }
+
+ .emotion-24 .e1jf5lit4 {
+ display: none;
+ }
+}
+
+@media (min-width:1024px) {
+ .emotion-24 .emotion-23 {
+ padding: 0 20px;
+ }
+
+@media (min-width:1275px) {
+ .emotion-24 .emotion-23 {
+ max-width: 1240px;
+ width: 100%;
+ margin: 0 auto;
+ }
+}
+}
+
+.emotion-22 {
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ padding: 0 15px;
+}
+
+.emotion-14 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ padding: 0;
+ -webkit-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
+}
+
+.emotion-2 {
+ margin-right: 1em;
+}
+
+.emotion-0 {
+ display: inline-block;
+ vertical-align: middle;
+ box-sizing: border-box;
+ background-position: center;
+ background-size: contain;
+ background-image: url([object Object]);
+ background-repeat: no-repeat;
+ width: 40px;
+ height: 40px;
+}
+
+.emotion-12 {
+ display: none;
+ max-width: 393px;
+ width: 100%;
+}
+
+.emotion-10 {
+ width: 100%;
+ height: 32px;
+ position: relative;
+ z-index: 1;
+}
+
+.emotion-6 .MuiInputBase-root:before {
+ content: '';
+ border: none;
+}
+
+.emotion-6 .MuiInputBase-root:after {
+ border-color: #fff;
+}
+
+.emotion-6 .MuiInputBase-root:hover:before {
+ content: none;
+}
+
+.emotion-6 .MuiInputBase-input {
+ color: #fff;
+}
+
+.emotion-4 {
+ color: #fff;
+}
+
+.emotion-8 {
+ max-height: 500px;
+ overflow-y: auto;
+}
+
+.emotion-20 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ padding: 0;
+}
+
+.emotion-16 {
+ display: block;
+}
+
+.emotion-18 {
+ color: #fff;
+}
+