mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-25 10:42:45 +00:00
* feat(app): modernize compact headers and sidebar affordances Use a shared island header with quick tab creation and keep sheet footers inside their visible layout. Opt sidebar rows into touch sizing without changing global appearance settings. * test(app): match darker light-theme workspace selection * test(app): align plugin journeys with compact header
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import { RotateCw } from "lucide-react-native";
|
|
import { withUnistyles } from "react-native-unistyles";
|
|
import { extraMutedIconColorMapping } from "@/components/ui/icon-button-chrome";
|
|
import { LoadingSpinner } from "@/components/ui/loading-spinner";
|
|
import { ToolbarButton, paneContentToolbarIconSize } from "@/components/ui/pane-content-toolbar";
|
|
import { useIsCompactFormFactor } from "@/constants/layout";
|
|
import { usageCopy } from "./copy";
|
|
|
|
const ThemedRotateCw = withUnistyles(RotateCw);
|
|
const ThemedLoadingSpinner = withUnistyles(LoadingSpinner);
|
|
|
|
/**
|
|
* Refreshes every report on the host; spins while a refresh is in flight. On compact it sits in the
|
|
* header's island, so its highlight is round.
|
|
*/
|
|
export function UsageRefreshButton({ busy, onRefresh }: { busy: boolean; onRefresh: () => void }) {
|
|
const compact = useIsCompactFormFactor();
|
|
const iconSize = paneContentToolbarIconSize(compact);
|
|
return (
|
|
<ToolbarButton
|
|
label={usageCopy.refreshAll}
|
|
compact={compact}
|
|
disabled={busy}
|
|
onPress={onRefresh}
|
|
testID="usage-refresh-all"
|
|
>
|
|
{busy ? (
|
|
<ThemedLoadingSpinner size={iconSize} uniProps={extraMutedIconColorMapping} />
|
|
) : (
|
|
<ThemedRotateCw size={iconSize} uniProps={extraMutedIconColorMapping} />
|
|
)}
|
|
</ToolbarButton>
|
|
);
|
|
}
|