Add searchbar to home screen

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2023-07-12 16:55:48 +03:00
parent ce8ef46c20
commit 5bf066ac98
13 changed files with 358 additions and 1560 deletions

View File

@@ -1,2 +1,2 @@
export { MEME_TYPE, Meme } from './meme';
export { MEME_TYPE, memeTypePlural, Meme } from './meme';
export { Tag } from './tag';

View File

@@ -2,18 +2,27 @@ import { Realm } from '@realm/react';
import { Tag } from './tag';
enum MEME_TYPE {
IMAGE = 'IMAGE',
IMAGE = 'Image',
GIF = 'GIF',
ALMBUM = 'ALMBUM',
VIDEO = 'VIDEO',
AUDIO = 'AUDIO',
TEXT = 'TEXT',
VIDEO = 'Video',
AUDIO = 'Audio',
ALBUM = 'Album',
TEXT = 'Text',
}
const memeTypePlural = {
[MEME_TYPE.IMAGE]: 'Images',
[MEME_TYPE.GIF]: 'GIFs',
[MEME_TYPE.VIDEO]: 'Videos',
[MEME_TYPE.AUDIO]: 'Audio',
[MEME_TYPE.ALBUM]: 'Albums',
[MEME_TYPE.TEXT]: 'Text',
};
class Meme extends Realm.Object<Meme> {
id!: Realm.BSON.UUID;
type!: MEME_TYPE;
uri!: string;
uri!: Realm.List<string>;
size!: number;
title!: string;
description?: string;
@@ -30,7 +39,7 @@ class Meme extends Realm.Object<Meme> {
properties: {
id: 'uuid',
type: { type: 'string', indexed: true },
uri: 'string',
uri: 'string[]',
size: 'int',
title: 'string',
description: 'string?',
@@ -44,4 +53,4 @@ class Meme extends Realm.Object<Meme> {
};
}
export { MEME_TYPE, Meme };
export { MEME_TYPE, memeTypePlural, Meme };