-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Errors component #731
Conversation
c9b4b3e
to
0eb7015
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Few comments.
src/components/extensions/Errors.js
Outdated
const formattedErrors = allErrors.map((error) => { | ||
const newError = ERRORS.find((item) => item.id === error); | ||
return newError; | ||
}).map((error) => { | ||
const errorArray = []; | ||
errorArray.push(<code className="language-text">{error.id}</code>) | ||
errorArray.push(error.message) | ||
errorArray.push(error.description) | ||
return errorArray; | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good, but let's make it better to avoid double iteration :)
const formattedErrors = allErrors.map((error) => { | |
const newError = ERRORS.find((item) => item.id === error); | |
return newError; | |
}).map((error) => { | |
const errorArray = []; | |
errorArray.push(<code className="language-text">{error.id}</code>) | |
errorArray.push(error.message) | |
errorArray.push(error.description) | |
return errorArray; | |
}) | |
const formattedErrors = allErrors.map((error) => { | |
const newError = ERRORS.find((item) => item.id === error); | |
return [ | |
<code className="language-text">{newError.id}</code>, | |
newError.message, | |
newError.description | |
]; | |
}) |
`; | ||
|
||
const Scopes = ({ title, scopes }) => { | ||
const Scopes = ({ scopes }) => { | ||
const allScopes = scopes.split(","); | ||
const formattedScopes = allScopes.map((scope) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here as above
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import styled from "@emotion/styled"; | ||
import { v4 as uuidv4 } from 'uuid'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
🚀 Links
📓 Description
Created a new component -
Errors
. It mirrors theScopes
component.👷 Type of change (remove not needed)
Features (for the website)