Move primitives

This commit is contained in:
Zoe Roux
2025-02-02 22:00:09 +01:00
parent 4a3d033562
commit c1e3a67a4e
74 changed files with 122 additions and 321 deletions
+2 -40
View File
@@ -1,9 +1,5 @@
import { type ComponentType, type ReactElement, isValidElement } from "react";
import { useTranslation } from "react-i18next";
import { View } from "react-native";
import { useYoshiki } from "yoshiki/native";
import { P } from "~/primitives";
import { ErrorView } from "./errors";
import type { ReactElement } from "react";
import { ErrorView, OfflineView } from "~/ui/errors";
import { type QueryIdentifier, useFetch } from "./query";
export const Fetch = <Data,>({
@@ -22,37 +18,3 @@ export const Fetch = <Data,>({
if (!data) return <Loader />;
return <Render {...data} />;
};
export const OfflineView = () => {
const { css } = useYoshiki();
const { t } = useTranslation();
return (
<View
{...css({
flexGrow: 1,
flexShrink: 1,
justifyContent: "center",
alignItems: "center",
})}
>
<P {...css({ color: (theme) => theme.colors.white })}>{t("errors.offline")}</P>
</View>
);
};
export const EmptyView = ({ message }: { message: string }) => {
const { css } = useYoshiki();
return (
<View
{...css({
flexGrow: 1,
justifyContent: "center",
alignItems: "center",
})}
>
<P {...css({ color: (theme) => theme.heading })}>{message}</P>
</View>
);
};