-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
965264a
commit 1d6281c
Showing
21 changed files
with
175 additions
and
144 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
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,5 +1,3 @@ | ||
{ | ||
"extends": [ | ||
"config:base" | ||
] | ||
"extends": ["config:base"] | ||
} |
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,7 +1,16 @@ | ||
export default function Loading() { | ||
return ( | ||
<div style={{ color: '#fff', minHeight: 100, display: 'flex', textAlign: 'center', justifyContent: 'center', alignItems: 'center' }}> | ||
<div | ||
style={{ | ||
color: '#fff', | ||
minHeight: 100, | ||
display: 'flex', | ||
textAlign: 'center', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<span>Loading...</span> | ||
</div> | ||
) | ||
} | ||
); | ||
} |
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 |
---|---|---|
@@ -1,35 +1,35 @@ | ||
import { useState, Fragment} from 'react'; | ||
import { useState, Fragment } from 'react'; | ||
import Input from '@uiw/react-input'; | ||
import Button from '@uiw/react-button'; | ||
import { useDispatch } from 'react-redux'; | ||
import { Link, useNavigate }from 'react-router-dom'; | ||
import { Link, useNavigate } from 'react-router-dom'; | ||
import { Dispatch } from '../models'; | ||
import styles from './Search.module.less'; | ||
|
||
export default function Search() { | ||
const dispatch = useDispatch<Dispatch>(); | ||
const [value, setValue] = useState<string>(); | ||
const navigate = useNavigate(); | ||
const [links] = useState<{to: string, label: string}[]>([ | ||
const [links] = useState<{ to: string; label: string }[]>([ | ||
{ | ||
to: '/pkg/uiw', | ||
label: 'uiw' | ||
label: 'uiw', | ||
}, | ||
{ | ||
to: '/pkg/vue', | ||
label: 'vue' | ||
label: 'vue', | ||
}, | ||
{ | ||
to: '/pkg/react', | ||
label: 'react' | ||
label: 'react', | ||
}, | ||
{ | ||
to: '/pkg/react@17', | ||
label: 'react@17' | ||
label: 'react@17', | ||
}, | ||
{ | ||
to: '/pkg/[email protected]', | ||
label: '[email protected]' | ||
label: '[email protected]', | ||
}, | ||
]); | ||
return ( | ||
|
@@ -42,12 +42,18 @@ export default function Search() { | |
setValue(e.target.value); | ||
}} | ||
addonAfter={ | ||
<Button onClick={() => { | ||
if (value) { | ||
dispatch.global.update({ showSearch: false }); | ||
navigate(`/pkg/${value}`); | ||
} | ||
}} icon="arrow-right" size="small" basic type="light" /> | ||
<Button | ||
onClick={() => { | ||
if (value) { | ||
dispatch.global.update({ showSearch: false }); | ||
navigate(`/pkg/${value}`); | ||
} | ||
}} | ||
icon="arrow-right" | ||
size="small" | ||
basic | ||
type="light" | ||
/> | ||
} | ||
placeholder="package or package@version" | ||
/> | ||
|
@@ -64,7 +70,7 @@ export default function Search() { | |
> | ||
{item.label} | ||
</Link> | ||
) | ||
); | ||
})} | ||
</div> | ||
</Fragment> | ||
|
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
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
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 |
---|---|---|
|
@@ -8,4 +8,4 @@ export default function Home() { | |
<Search /> | ||
</div> | ||
); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -32,4 +32,4 @@ | |
background-color: #333; | ||
color: #fff; | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
line-height: 16px; | ||
align-self: center; | ||
margin-right: -6px !important; | ||
} | ||
} |
Oops, something went wrong.