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",
StartAir = "startAir",
EndAir = "endAir",
AddedDate = "addedDate",
}
export enum SortOrd {

View File

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

View File

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

View File

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