Skip to content

Commit 0448e5a

Browse files
committed
Docs - various fixes
1 parent d995531 commit 0448e5a

File tree

10 files changed

+35
-27
lines changed

10 files changed

+35
-27
lines changed

uilib-docs/src/components/header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Header = ({githubDomain}) => {
1313

1414
<div className="links">
1515
<Link to="/getting-started/setup">Docs</Link>
16-
<a target="_blank" href={githubDomain}>
16+
<a target="_blank" rel="noreferrer" href={githubDomain}>
1717
GitHub
1818
</a>
1919
</div>

uilib-docs/src/components/navbar/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ class Navbar extends Component {
6464
});
6565
return (
6666
<div className="search">
67-
<img src={searchIcon} />
67+
<img src={searchIcon} alt="search" />
6868
<input
6969
placeholder="Search..."
7070
onChange={this.setFilter}
7171
value={filter}
7272
/>
7373
<button className={clearButtonClassName} onClick={this.resetSearch}>
74-
<img src={clearIcon} />
74+
<img src={clearIcon} alt="clear search" />
7575
</button>
7676
</div>
7777
);
@@ -96,16 +96,17 @@ class Navbar extends Component {
9696
{this.renderSearch()}
9797
<ul>
9898
{_.map(markdowns, page => {
99-
return <Item id={page.title} link={page.path} />;
99+
return <Item key={page.title} id={page.title} link={page.path} />;
100100
})}
101101
<li className="separator" />
102102
{_.map(componentsByGroups, (components, key) => {
103103
return (
104104
<Item
105+
key={key}
105106
id={key}
106107
components={components}
107108
currentPage={currentPage}
108-
></Item>
109+
/>
109110
);
110111
})}
111112
</ul>

uilib-docs/src/components/navbar/item.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ export default ({id, link, components, currentPage}) => {
1414
return (
1515
<li key={id}>
1616
{undocumentedGroups.includes(id) ? (
17-
<span class={classnames('entry', {selected: id === currentPage})}>{id}</span>
17+
<span className={classnames('entry', {selected: id === currentPage})}>{id}</span>
1818
) : (
1919
<Link key={id} to={`/docs/${id}/`}>
20-
<span class={classnames('entry', {selected: id === currentPage})}>{id}</span>
20+
<span className={classnames('entry', {selected: id === currentPage})}>{id}</span>
2121
</Link>
2222
)}
2323

24-
<ul class="nested">
24+
<ul className="nested">
2525
{_.map(_.filter(components, c => c.node.displayName !== id), c => {
2626
return (
27-
<ItemEntry id={c.node.displayName} currentPage={currentPage} />
27+
<ItemEntry id={c.node.displayName} key={c.node.displayName} currentPage={currentPage} />
2828
);
2929
})}
3030
</ul>
@@ -37,7 +37,7 @@ const ItemEntry = ({id, link, currentPage}) => {
3737
return (
3838
<li key={id}>
3939
<Link key={id} to={link || `/docs/${id}/`}>
40-
<span class={classnames('entry', {selected: id === currentPage})}>
40+
<span className={classnames('entry', {selected: id === currentPage})}>
4141
{id}
4242
</span>
4343
</Link>

uilib-docs/src/pages/sections/CodeSection.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, {useState, useCallback} from 'react';
1+
import React, {useState} from 'react';
22
import Link from 'gatsby-link';
33
import classnames from 'classnames';
44

@@ -37,7 +37,14 @@ const TabBar = ({onChangeIndex, selectedIndex}) => {
3737
{['Foundation', 'Theme', 'Modifiers'].map((title, index) => {
3838
const tabClassName = classnames('tab', {selected: selectedIndex === index});
3939
return (
40-
<div className={tabClassName} onClick={() => onChangeIndex(index)}>
40+
<div
41+
key={title}
42+
className={tabClassName}
43+
onClick={() => onChangeIndex(index)}
44+
onKeyPress={() => onChangeIndex(index)}
45+
role="tab"
46+
tabIndex={index}
47+
>
4148
{title}
4249
</div>
4350
);

uilib-docs/src/pages/sections/ComponentsSection.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default () => {
1515
<button className="dark">View Docs</button>
1616
</Link>
1717
</div>
18-
<img src={showcase} />
18+
<img src={showcase} alt="showcase" />
1919
</div>
2020
);
2121
};

uilib-docs/src/pages/sections/InfoSection.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,32 @@ import qr from '../../images/newDesign/qr.png';
44

55
export default () => {
66
return (
7-
<div class="info-section">
7+
<div className="info-section">
88
<div className="flex-row">
99
<div className="column">
1010
<h6 className="title">Try our Expo App</h6>
11-
<img className="qr" src={qr} />
11+
<img className="qr" src={qr} alt="QR code" />
1212
</div>
1313
<div className="column">
1414
<h6 className="title">Find Us</h6>
1515
<ul>
1616
<li>
17-
<a target="_blank" href="https://twitter.com/rnuilib">
17+
<a target="_blank" rel="noreferrer" href="https://twitter.com/rnuilib">
1818
Twitter
1919
</a>
2020
</li>
2121
<li>
22-
<a target="_blank" href="https://discord.gg/2eW4g6Z">
22+
<a target="_blank" rel="noreferrer" href="https://discord.gg/2eW4g6Z">
2323
Discord
2424
</a>
2525
</li>
2626
<li>
27-
<a target="_blank" href="https://snack.expo.io/@ethanshar/rnuilib_snack">
27+
<a target="_blank" rel="noreferrer" href="https://snack.expo.io/@ethanshar/rnuilib_snack">
2828
Expo-Snack
2929
</a>
3030
</li>
3131
<li>
32-
<a target="_blank" href="https://github.com/wix/react-native-ui-lib">
32+
<a target="_blank" rel="noreferrer" href="https://github.com/wix/react-native-ui-lib">
3333
Github
3434
</a>
3535
</li>

uilib-docs/src/pages/sections/IntroSection.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import goldStar from '../../images/goldStar.svg';
77
export default () => {
88
return (
99
<div className="intro">
10-
<img src={introCover} className="intro-cover" />
10+
<img src={introCover} alt="showcase" className="intro-cover" />
1111
<div className="intro-inner">
1212
<div className="intro-content">
1313
<p>
1414
<span className="lib-name">RNUI</span> is a UI Toolset & Components Library for React Native
1515
</p>
1616
<div className="git-stars">
17-
<img src={goldStar} />
17+
<img src={goldStar} alt="gold star" />
1818
<span className="star-count">2.7k</span>
1919
</div>
2020

uilib-docs/src/pages/sections/LibrariesSection.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Library = ({image, name, link}) => {
2525
return (
2626
<a href={link} target="_blank" rel="noopener noreferrer">
2727
<div className="library">
28-
<img src={image} />
28+
<img src={image} alt={name} />
2929
<h5 className="name">{name}</h5>
3030
</div>
3131
</a>

uilib-docs/src/pages/sections/RtlAndAccessibilitySection.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default () => {
2020
const Card = ({image, title, description}) => {
2121
return (
2222
<div className="card">
23-
<img src={image} />
23+
<img src={image} alt={title} />
2424
<h3 className="title">{title}</h3>
2525
<p>{description}</p>
2626
</div>

uilib-docs/src/templates/component.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default class ComponentTemplate extends Component {
135135
return (
136136
<div className="notes">
137137
<span className="title">
138-
<img src={importantIcon} /> Important
138+
<img src={importantIcon} alt="important" /> Important
139139
</span>
140140
{_.map(notes, (note, i) => (
141141
<div key={i}>{note}</div>
@@ -193,7 +193,7 @@ export default class ComponentTemplate extends Component {
193193
<h2 className="title inline">{selectedComponent.displayName}</h2>
194194
{_.map(examples, example => {
195195
return (
196-
<span className="code-example">
196+
<span key={example} className="code-example">
197197
(
198198
<a className="inline" target="_blank" rel="noopener noreferrer" href={example}>
199199
code example
@@ -249,7 +249,7 @@ const ComponentAPI = ({props, href = ''}) => {
249249
const isFocused = _.includes(href, `#${prop.name}`);
250250
const titleClassname = classnames('title', {focused: isFocused});
251251
return (
252-
<div className="prop-info">
252+
<div key={prop.name} className="prop-info">
253253
<a name={prop.name}>
254254
<h5 className={titleClassname}>{prop.name}</h5>
255255
</a>
@@ -271,7 +271,7 @@ const TableOfContent = ({props}) => {
271271

272272
{_.map(props, prop => {
273273
return (
274-
<li>
274+
<li key={prop.name}>
275275
<a href={`#${prop.name}`}>{prop.name}</a>
276276
</li>
277277
);

0 commit comments

Comments
 (0)