mirror of
https://github.com/urbit/shrub.git
synced 2024-12-25 04:52:06 +03:00
favicon: adding temp favicon and added symbol ignoring to leap
This commit is contained in:
parent
65b9f229c5
commit
e69395d46d
@ -2,7 +2,8 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
|
||||
<link rel="icon" href="/src/assets/favicon.png" />
|
||||
<link rel="icon" href="/src/assets/favicon.svg" sizes="any" type="image/svg+xml" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Landscape • Home</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
|
BIN
pkg/grid/src/assets/favicon.png
Normal file
BIN
pkg/grid/src/assets/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
11
pkg/grid/src/assets/favicon.svg
Normal file
11
pkg/grid/src/assets/favicon.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
@media (prefers-color-scheme: dark) {
|
||||
rect { fill: #ffffff; }
|
||||
}
|
||||
</style>
|
||||
<rect x="51" y="51" width="173" height="173" rx="24" fill="#444444"/>
|
||||
<rect x="51" y="288" width="173" height="173" rx="24" fill="#444444"/>
|
||||
<rect x="288" y="51" width="173" height="173" rx="24" fill="#444444"/>
|
||||
<rect x="288" y="288" width="173" height="173" rx="24" fill="#444444"/>
|
||||
</svg>
|
After Width: | Height: | Size: 474 B |
@ -1,15 +0,0 @@
|
||||
<svg width="410" height="404" viewBox="0 0 410 404" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M399.641 59.5246L215.643 388.545C211.844 395.338 202.084 395.378 198.228 388.618L10.5817 59.5563C6.38087 52.1896 12.6802 43.2665 21.0281 44.7586L205.223 77.6824C206.398 77.8924 207.601 77.8904 208.776 77.6763L389.119 44.8058C397.439 43.2894 403.768 52.1434 399.641 59.5246Z" fill="url(#paint0_linear)"/>
|
||||
<path d="M292.965 1.5744L156.801 28.2552C154.563 28.6937 152.906 30.5903 152.771 32.8664L144.395 174.33C144.198 177.662 147.258 180.248 150.51 179.498L188.42 170.749C191.967 169.931 195.172 173.055 194.443 176.622L183.18 231.775C182.422 235.487 185.907 238.661 189.532 237.56L212.947 230.446C216.577 229.344 220.065 232.527 219.297 236.242L201.398 322.875C200.278 328.294 207.486 331.249 210.492 326.603L212.5 323.5L323.454 102.072C325.312 98.3645 322.108 94.137 318.036 94.9228L279.014 102.454C275.347 103.161 272.227 99.746 273.262 96.1583L298.731 7.86689C299.767 4.27314 296.636 0.855181 292.965 1.5744Z" fill="url(#paint1_linear)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear" x1="6.00017" y1="32.9999" x2="235" y2="344" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#41D1FF"/>
|
||||
<stop offset="1" stop-color="#BD34FE"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear" x1="194.651" y1="8.81818" x2="236.076" y2="292.989" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FFEA83"/>
|
||||
<stop offset="0.0833333" stop-color="#FFDD35"/>
|
||||
<stop offset="1" stop-color="#FFA800"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.5 KiB |
@ -38,6 +38,16 @@ type LeapProps = {
|
||||
shouldDim: boolean;
|
||||
} & HTMLAttributes<HTMLDivElement>;
|
||||
|
||||
function normalizeMatchString(match: string, keepAltChars: boolean): string {
|
||||
let normalizedString = match.toLocaleLowerCase().trim();
|
||||
|
||||
if (!keepAltChars) {
|
||||
normalizedString = normalizedString.replace(/[^\w]/, '');
|
||||
}
|
||||
|
||||
return normalizedString;
|
||||
}
|
||||
|
||||
export const Leap = React.forwardRef(
|
||||
({ menu, dropdown, navOpen, shouldDim, className }: LeapProps, ref) => {
|
||||
const { push } = useHistory();
|
||||
@ -78,11 +88,12 @@ export const Leap = React.forwardRef(
|
||||
|
||||
const getMatch = useCallback(
|
||||
(value: string) => {
|
||||
const normValue = value.toLocaleLowerCase();
|
||||
const onlySymbols = !value.match(/[\w]/g);
|
||||
const normValue = normalizeMatchString(value, onlySymbols);
|
||||
return matches.find(
|
||||
(m) =>
|
||||
m.display?.toLocaleLowerCase().startsWith(normValue) ||
|
||||
m.value.toLocaleLowerCase().startsWith(normValue)
|
||||
(m.display && normalizeMatchString(m.display, onlySymbols).startsWith(normValue)) ||
|
||||
normalizeMatchString(m.value, onlySymbols).startsWith(normValue)
|
||||
);
|
||||
},
|
||||
[matches]
|
||||
@ -121,7 +132,10 @@ export const Leap = React.forwardRef(
|
||||
|
||||
if (matchValue && inputRef.current && !isDeletion) {
|
||||
inputRef.current.value = matchValue;
|
||||
inputRef.current.setSelectionRange(value.length, matchValue.length);
|
||||
const start = matchValue.startsWith(value)
|
||||
? value.length
|
||||
: matchValue.substring(0, matchValue.indexOf(value)).length + value.length;
|
||||
inputRef.current.setSelectionRange(start, matchValue.length);
|
||||
useLeapStore.setState({
|
||||
rawInput: matchValue,
|
||||
selectedMatch: inputMatch
|
||||
|
@ -6,6 +6,7 @@ import { ShipName } from '../../components/ShipName';
|
||||
import useDocketState, { useAllyTreaties } from '../../state/docket';
|
||||
import { useLeapStore } from '../Nav';
|
||||
import { AppList } from '../../components/AppList';
|
||||
import { addRecentDev } from './Home';
|
||||
|
||||
type AppsProps = RouteComponentProps<{ ship: string }>;
|
||||
|
||||
@ -68,6 +69,7 @@ export const Apps = ({ match }: AppsProps) => {
|
||||
useEffect(() => {
|
||||
if (provider) {
|
||||
useDocketState.getState().fetchAllyTreaties(provider);
|
||||
addRecentDev(provider);
|
||||
}
|
||||
}, [provider]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user