mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-28 05:58:38 +02:00
chore(v2): fix code style (revert previous changes)
This commit is contained in:
parent
1480a7eb80
commit
1f00d15c74
143 changed files with 457 additions and 458 deletions
|
@ -65,11 +65,11 @@ function ColorGenerator({children, minHeight, url}) {
|
|||
const [shades, setShades] = useState(COLOR_SHADES);
|
||||
const color = Color('#' + baseColor);
|
||||
const adjustedColors = Object.keys(shades)
|
||||
.map(shade => ({
|
||||
.map((shade) => ({
|
||||
...shades[shade],
|
||||
variableName: shade,
|
||||
}))
|
||||
.map(value => ({
|
||||
.map((value) => ({
|
||||
...value,
|
||||
hex: color.darken(value.adjustment).hex(),
|
||||
}));
|
||||
|
@ -84,7 +84,7 @@ function ColorGenerator({children, minHeight, url}) {
|
|||
id="primary_color"
|
||||
className={styles.input}
|
||||
defaultValue={baseColor}
|
||||
onChange={event => {
|
||||
onChange={(event) => {
|
||||
const colorValue = event.target.value;
|
||||
try {
|
||||
Color('#' + colorValue);
|
||||
|
@ -107,7 +107,7 @@ function ColorGenerator({children, minHeight, url}) {
|
|||
<tbody>
|
||||
{adjustedColors
|
||||
.sort((a, b) => a.displayOrder - b.displayOrder)
|
||||
.map(value => {
|
||||
.map((value) => {
|
||||
const {variableName, adjustment, adjustmentInput, hex} = value;
|
||||
return (
|
||||
<tr key={variableName}>
|
||||
|
@ -134,7 +134,7 @@ function ColorGenerator({children, minHeight, url}) {
|
|||
className={styles.input}
|
||||
type="number"
|
||||
value={adjustmentInput}
|
||||
onChange={event => {
|
||||
onChange={(event) => {
|
||||
const newValue = parseFloat(event.target.value);
|
||||
setShades({
|
||||
...shades,
|
||||
|
@ -163,7 +163,7 @@ function ColorGenerator({children, minHeight, url}) {
|
|||
<CodeBlock className="css">
|
||||
{adjustedColors
|
||||
.sort((a, b) => a.codeOrder - b.codeOrder)
|
||||
.map(value => `${value.variableName}: ${value.hex.toLowerCase()};`)
|
||||
.map((value) => `${value.variableName}: ${value.hex.toLowerCase()};`)
|
||||
.join('\n')}
|
||||
</CodeBlock>
|
||||
</div>
|
||||
|
|
|
@ -201,7 +201,7 @@ function Home() {
|
|||
<div className={classnames(styles.section, styles.sectionAlt)}>
|
||||
<div className="container">
|
||||
<div className="row">
|
||||
{QUOTES.map(quote => (
|
||||
{QUOTES.map((quote) => (
|
||||
<div className="col" key={quote.name}>
|
||||
<div className="avatar avatar--vertical margin-bottom--sm">
|
||||
<Image
|
||||
|
|
|
@ -27,7 +27,7 @@ function Showcase() {
|
|||
<p>{DESCRIPTION}</p>
|
||||
</div>
|
||||
<div className="row">
|
||||
{users.map(user => (
|
||||
{users.map((user) => (
|
||||
<div key={user.title} className="col col--4 margin-bottom--lg">
|
||||
<div className={classnames('card', styles.showcaseUser)}>
|
||||
<div className="card__image">
|
||||
|
|
|
@ -19,7 +19,7 @@ function Version() {
|
|||
const context = useDocusaurusContext();
|
||||
const {siteConfig = {}} = context;
|
||||
const latestVersion = versions[0];
|
||||
const pastVersions = versions.filter(version => version !== latestVersion);
|
||||
const pastVersions = versions.filter((version) => version !== latestVersion);
|
||||
const repoUrl = `https://github.com/${siteConfig.organizationName}/${siteConfig.projectName}`;
|
||||
return (
|
||||
<Layout
|
||||
|
@ -76,7 +76,7 @@ function Version() {
|
|||
</p>
|
||||
<table>
|
||||
<tbody>
|
||||
{pastVersions.map(version => (
|
||||
{pastVersions.map((version) => (
|
||||
<tr key={version}>
|
||||
<th>{version}</th>
|
||||
<td>
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
const npmToYarn = require('npm-to-yarn');
|
||||
|
||||
// E.g. global install: 'npm i' -> 'yarn'
|
||||
const convertNpmToYarn = npmCode => npmToYarn(npmCode, 'yarn');
|
||||
const convertNpmToYarn = (npmCode) => npmToYarn(npmCode, 'yarn');
|
||||
|
||||
const transformNode = node => {
|
||||
const transformNode = (node) => {
|
||||
const npmCode = node.value;
|
||||
const yarnCode = convertNpmToYarn(node.value);
|
||||
return [
|
||||
|
@ -46,7 +46,7 @@ const transformNode = node => {
|
|||
];
|
||||
};
|
||||
|
||||
const matchNode = node => node.type === 'code' && node.meta === 'npm2yarn';
|
||||
const matchNode = (node) => node.type === 'code' && node.meta === 'npm2yarn';
|
||||
const nodeForImport = {
|
||||
type: 'import',
|
||||
value:
|
||||
|
@ -55,7 +55,7 @@ const nodeForImport = {
|
|||
|
||||
module.exports = () => {
|
||||
let transformed = false;
|
||||
const transformer = node => {
|
||||
const transformer = (node) => {
|
||||
if (matchNode(node)) {
|
||||
transformed = true;
|
||||
return transformNode(node);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// Provided by Canny.
|
||||
|
||||
function canny() {
|
||||
!(function(w, d, i, s) {
|
||||
!(function (w, d, i, s) {
|
||||
function l() {
|
||||
if (!d.getElementById(i)) {
|
||||
let f = d.getElementsByTagName(s)[0],
|
||||
|
@ -20,7 +20,7 @@ function canny() {
|
|||
}
|
||||
}
|
||||
if (typeof w.Canny !== 'function') {
|
||||
var c = function() {
|
||||
var c = function () {
|
||||
c.q.push(arguments);
|
||||
};
|
||||
(c.q = []),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue