-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add support for easy title + descriptions on web :)
- Loading branch information
1 parent
bbcc08f
commit bcc0cfb
Showing
11 changed files
with
224 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
|
||
if [ "$LEFTHOOK" = "0" ]; then | ||
exit 0 | ||
fi | ||
|
||
if [ -t 1 ] ; then | ||
exec < /dev/tty ; # <- enables interactive shell | ||
fi | ||
|
||
dir="$(git rev-parse --show-toplevel)" | ||
|
||
call_lefthook() | ||
{ | ||
if lefthook -h >/dev/null 2>&1 | ||
then | ||
eval lefthook $@ | ||
elif test -f "$dir/node_modules/@arkweid/lefthook/bin/lefthook" | ||
then | ||
eval "$dir/node_modules/@arkweid/lefthook/bin/lefthook $@" | ||
elif bundle exec lefthook -h >/dev/null 2>&1 | ||
then | ||
bundle exec lefthook $@ | ||
elif npx @arkweid/lefthook -h >/dev/null 2>&1 | ||
then | ||
npx @arkweid/lefthook $@ | ||
elif yarn lefthook -h >/dev/null 2>&1 | ||
then | ||
yarn lefthook $@ | ||
else | ||
echo "Can't find lefthook in PATH" | ||
fi | ||
} | ||
|
||
|
||
|
||
call_lefthook "run commit-msg $@" |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
|
||
if [ "$LEFTHOOK" = "0" ]; then | ||
exit 0 | ||
fi | ||
|
||
if [ -t 1 ] ; then | ||
exec < /dev/tty ; # <- enables interactive shell | ||
fi | ||
|
||
dir="$(git rev-parse --show-toplevel)" | ||
|
||
call_lefthook() | ||
{ | ||
if lefthook -h >/dev/null 2>&1 | ||
then | ||
eval lefthook $@ | ||
elif test -f "$dir/node_modules/@arkweid/lefthook/bin/lefthook" | ||
then | ||
eval "$dir/node_modules/@arkweid/lefthook/bin/lefthook $@" | ||
elif bundle exec lefthook -h >/dev/null 2>&1 | ||
then | ||
bundle exec lefthook $@ | ||
elif npx @arkweid/lefthook -h >/dev/null 2>&1 | ||
then | ||
npx @arkweid/lefthook $@ | ||
elif yarn lefthook -h >/dev/null 2>&1 | ||
then | ||
yarn lefthook $@ | ||
else | ||
echo "Can't find lefthook in PATH" | ||
fi | ||
} | ||
|
||
|
||
|
||
call_lefthook "run pre-commit $@" |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
if [ "$LEFTHOOK" = "0" ]; then | ||
exit 0 | ||
fi | ||
|
||
if [ -t 1 ] ; then | ||
exec < /dev/tty ; # <- enables interactive shell | ||
fi | ||
|
||
dir="$(git rev-parse --show-toplevel)" | ||
|
||
call_lefthook() | ||
{ | ||
if lefthook -h >/dev/null 2>&1 | ||
then | ||
eval lefthook $@ | ||
elif test -f "$dir/node_modules/@arkweid/lefthook/bin/lefthook" | ||
then | ||
eval "$dir/node_modules/@arkweid/lefthook/bin/lefthook $@" | ||
elif bundle exec lefthook -h >/dev/null 2>&1 | ||
then | ||
bundle exec lefthook $@ | ||
elif npx @arkweid/lefthook -h >/dev/null 2>&1 | ||
then | ||
npx @arkweid/lefthook $@ | ||
elif yarn lefthook -h >/dev/null 2>&1 | ||
then | ||
yarn lefthook $@ | ||
else | ||
echo "Can't find lefthook in PATH" | ||
fi | ||
} | ||
|
||
# lefthook_version: 9df6c1f1f0b607d16db43f25a405e842 | ||
|
||
call_lefthook "install" | ||
|
||
call_lefthook "run prepare-commit-msg $@" |
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 |
---|---|---|
@@ -1,12 +1,27 @@ | ||
import * as React from 'react'; | ||
import type { StatusBarProps } from 'expo-status-bar'; | ||
|
||
const getElement = () => document.querySelector('meta[name=theme-color]'); | ||
function StatusBar({ backgroundColor }: StatusBarProps) { | ||
const originalColor = React.useRef<string | null>( | ||
getElement()?.getAttribute('content') || null | ||
); | ||
|
||
React.useEffect(() => { | ||
if (backgroundColor && typeof backgroundColor === 'string') { | ||
const themeColor = document.querySelector('meta[name=theme-color]'); | ||
const themeColor = getElement(); | ||
themeColor?.setAttribute('content', backgroundColor); | ||
|
||
const orgColor = originalColor.current; | ||
return () => { | ||
if (orgColor) { | ||
themeColor?.setAttribute('content', orgColor); | ||
} else { | ||
themeColor?.remove(); | ||
} | ||
}; | ||
} | ||
return undefined; | ||
}, [backgroundColor]); | ||
return null; | ||
} | ||
export default StatusBar; | ||
export default React.memo(StatusBar); |
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
Oops, something went wrong.