Skip to content
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

style: format code with Prettier and StandardJS #459

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/stateless/AutoLink/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const AutoLink = ({ text }) => {
if (match) {
const url = match[0]
return (
<a target="_blank" href={url.startsWith('http') ? url : `http://${url}`}>
<a target='_blank' href={url.startsWith('http') ? url : `http://${url}`} rel='noreferrer'>
{url}
</a>
)
Expand Down
5 changes: 3 additions & 2 deletions src/components/stateless/StarRating/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styles from './index.module.less'

const Star = ({ marked, starId }) => {
return (
<span data-star-id={starId} className={styles.star} role="button">
<span data-star-id={starId} className={styles.star} role='button'>
{marked ? '\u2605' : '\u2606'}
</span>
)
Expand All @@ -15,8 +15,9 @@ const StarRating = ({ value }) => {

const hoverOver = (event) => {
let val = 0
if (event && event.target && event.target.getAttribute('data-star-id'))
if (event && event.target && event.target.getAttribute('data-star-id')) {
val = event.target.getAttribute('data-star-id')
}
setSelection(val)
}
return (
Expand Down
18 changes: 9 additions & 9 deletions src/pages/home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const Home = () => {
[
{
content: text,
role: 'user',
},
role: 'user'
}
],
key,
signal
Expand Down Expand Up @@ -155,20 +155,20 @@ const Home = () => {
I love coding in <AlternatingText alternateText={['javascript', 'typescript', 'rect', 'vue']} />.
</section>
<section>
<AutoLink text="foo bar baz http://example.org bar https://github.com/wkylin/pro-react-admin" />
<AutoLink text='foo bar baz http://example.org bar https://github.com/wkylin/pro-react-admin' />
</section>
<section>
<LazyLoadImage src="https://picsum.photos/seed/picsum/300/160" alt="Strawberries" />
<LazyLoadImage src='https://picsum.photos/seed/picsum/300/160' alt='Strawberries' />
</section>
<StarRating value={2} />
<section style={{ width: 600, margin: '30px 0' }}>
<Input defaultValue={apiKey} placeholder="api key" onChange={changeApiKey} style={{ marginBottom: 20 }} />
<Flex align="center">
<Input defaultValue={apiKey} placeholder='api key' onChange={changeApiKey} style={{ marginBottom: 20 }} />
<Flex align='center'>
<LinearWrap>
<Input.TextArea
ref={textareaRef}
defaultValue={chatText}
placeholder="来,说点什么呗...Meta + Enter发送"
placeholder='来,说点什么呗...Meta + Enter发送'
onChange={changeChatText}
onKeyDown={onInputKeyDown}
autoSize
Expand All @@ -178,13 +178,13 @@ const Home = () => {
<Button
style={{ margin: '0 10px' }}
icon={<SendOutlined rotate={-60} />}
type="primary"
type='primary'
disabled={isStream}
onClick={onSubmit}
>
发送
</Button>
<Button icon={<SendOutlined rotate={-60} />} type="primary" disabled={!isStream} onClick={onStop}>
<Button icon={<SendOutlined rotate={-60} />} type='primary' disabled={!isStream} onClick={onStop}>
停止
</Button>
</Flex>
Expand Down
Loading