-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding dedicated subpages for every DS (#104)
* #97 - WIP - Adds react-router-dom. Adds wip version of details page. Slices main view into smaller components. * #97 Adds basic css styles * #97 - Adds icons * #97 - small styling changes * #97 - Adds observer to add breadcrumbs + CSS styling adjustments * #97 - Adds small adjustments in styles. Adds inline documentation to the 'data' service. * #97 - updates tests specs (fixes #97)
- Loading branch information
Showing
24 changed files
with
1,942 additions
and
1,061 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Link } from 'react-router-dom'; | ||
import styled from 'styled-components'; | ||
import { table } from '../../style_tokens/tokens'; | ||
import { clearKey } from '../../helpers/text'; | ||
|
||
export function InternalLinkCell({ value, route }) { | ||
const to = clearKey(route); | ||
|
||
return ( | ||
<StyledLink to={to}> | ||
{value} | ||
</StyledLink> | ||
); | ||
} | ||
|
||
InternalLinkCell.propTypes = { | ||
route: PropTypes.string.isRequired, | ||
value: PropTypes.string.isRequired, | ||
}; | ||
|
||
export const StyledLink = styled(Link)` | ||
color: ${table.typography.color}; | ||
display: flex; | ||
padding-left: ${table.space.cellPadding}; | ||
padding-right: ${table.space.cellPadding}; | ||
text-decoration: none; | ||
&:hover { | ||
color: ${table.typography.hoveredLink}; | ||
text-decoration: underline; | ||
span > svg { | ||
fill: ${table.typography.hoveredLink}; | ||
} | ||
} | ||
span { | ||
align-items: center; | ||
display: flex; | ||
height: 24px; | ||
margin-right: 3px; | ||
width: 14px; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 63 additions & 26 deletions
89
src/components/logo/tests/__snapshots__/logo.test.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,69 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders Logo correctly 1`] = ` | ||
<Logo | ||
tab={0} | ||
> | ||
<a | ||
href="https://www.uxpin.com?utm_source=adele.uxpin.com&utm_medium=upartner&utm_campaign=Adele" | ||
rel="noopener noreferrer" | ||
tabIndex={0} | ||
target="_blank" | ||
title="UXPin logo" | ||
<BrowserRouter> | ||
<Router | ||
history={ | ||
Object { | ||
"action": "POP", | ||
"block": [Function], | ||
"createHref": [Function], | ||
"go": [Function], | ||
"goBack": [Function], | ||
"goForward": [Function], | ||
"length": 1, | ||
"listen": [Function], | ||
"location": Object { | ||
"hash": "", | ||
"pathname": "/", | ||
"search": "", | ||
"state": undefined, | ||
}, | ||
"push": [Function], | ||
"replace": [Function], | ||
} | ||
} | ||
> | ||
<SVGInline | ||
classSuffix="-svg" | ||
cleanup={Array []} | ||
cleanupExceptions={Array []} | ||
component="span" | ||
svg="test-file-stub" | ||
<Logo | ||
tab={0} | ||
> | ||
<span | ||
className="SVGInline" | ||
dangerouslySetInnerHTML={ | ||
Object { | ||
"__html": "test-file-stub", | ||
} | ||
} | ||
/> | ||
</SVGInline> | ||
</a> | ||
</Logo> | ||
<Link | ||
tabIndex={0} | ||
title="UXPin logo" | ||
to="/" | ||
> | ||
<LinkAnchor | ||
href="/" | ||
navigate={[Function]} | ||
tabIndex={0} | ||
title="UXPin logo" | ||
> | ||
<a | ||
href="/" | ||
onClick={[Function]} | ||
tabIndex={0} | ||
title="UXPin logo" | ||
> | ||
<SVGInline | ||
classSuffix="-svg" | ||
cleanup={Array []} | ||
cleanupExceptions={Array []} | ||
component="span" | ||
svg="test-file-stub" | ||
> | ||
<span | ||
className="SVGInline" | ||
dangerouslySetInnerHTML={ | ||
Object { | ||
"__html": "test-file-stub", | ||
} | ||
} | ||
/> | ||
</SVGInline> | ||
</a> | ||
</LinkAnchor> | ||
</Link> | ||
</Logo> | ||
</Router> | ||
</BrowserRouter> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import { mount } from 'enzyme'; | ||
import React from 'react'; | ||
import 'jest-styled-components'; | ||
import { BrowserRouter } from 'react-router-dom'; | ||
|
||
import Logo from '../logo'; | ||
|
||
it('renders Logo correctly', () => { | ||
const wrapper = mount(<Logo />); | ||
const wrapper = mount(<BrowserRouter><Logo /></BrowserRouter>); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.