Use random image and added date sort on the front

This commit is contained in:
Zoe Roux 2023-09-07 22:41:59 +02:00
parent 5f6e96333c
commit 4217d471c4
4 changed files with 8 additions and 5 deletions

View File

@ -22,6 +22,7 @@ export enum SortBy {
Name = "name", Name = "name",
StartAir = "startAir", StartAir = "startAir",
EndAir = "endAir", EndAir = "endAir",
AddedDate = "addedDate",
} }
export enum SortOrd { export enum SortOrd {

View File

@ -18,6 +18,7 @@
* along with Kyoo. If not, see <https://www.gnu.org/licenses/>. * along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { imageFn } from "@kyoo/models";
import { ts } from "@kyoo/primitives"; import { ts } from "@kyoo/primitives";
import { ReactNode } from "react"; import { ReactNode } from "react";
import { ScrollView, ImageBackground, ImageProps, Platform, View } from "react-native"; import { ScrollView, ImageBackground, ImageProps, Platform, View } from "react-native";
@ -42,11 +43,10 @@ const SvgBlob = (props: SvgProps) => {
export const FormPage = ({ children, ...props }: { children: ReactNode } & Stylable) => { export const FormPage = ({ children, ...props }: { children: ReactNode } & Stylable) => {
const { css } = useYoshiki(); const { css } = useYoshiki();
// TODO: Replace the hardcoded 1 to a random show/movie thumbnail. const src = imageFn("/items/random/thumbnail");
const src = `${Platform.OS === "web" ? "/api" : process.env.PUBLIC_BACK_URL}/shows/1/thumbnail`;
const nativeProps = Platform.select<Partial<ImageProps>>({ const nativeProps = Platform.select<Partial<ImageProps>>({
web: { web: {
defaultSource: typeof src === "string" ? { uri: src! } : Array.isArray(src) ? src[0] : src!, defaultSource: { uri: src },
}, },
default: {}, default: {},
}); });

View File

@ -18,7 +18,8 @@
"sortkey": { "sortkey": {
"name": "Name", "name": "Name",
"startAir": "Start air", "startAir": "Start air",
"endAir": "End air" "endAir": "End air",
"addedDate": "Added date"
}, },
"sortord": { "sortord": {
"asc": "asc", "asc": "asc",

View File

@ -18,7 +18,8 @@
"sortkey": { "sortkey": {
"name": "Nom", "name": "Nom",
"startAir": "Date de sortie", "startAir": "Date de sortie",
"endAir": "Date de fin de sortie" "endAir": "Date de fin de sortie",
"addedDate": "Date d'ajout"
}, },
"sortord": { "sortord": {
"asc": "asc", "asc": "asc",