diff --git a/.env.example b/.env.example index fb4546e9a..25d43ec9e 100644 --- a/.env.example +++ b/.env.example @@ -6,3 +6,7 @@ VITE_BUILD_TYPE=production VITE_INBOXES_EMAIL=@follow.re VITE_OPENPANEL_CLIENT_ID= VITE_OPENPANEL_API_URL= + +EXPO_PUBLIC_API_URL=https://api.follow.is +EXPO_PUBLIC_OPENPANEL_CLIENT_ID= +EXPO_PUBLIC_OPENPANEL_API_URL= diff --git a/.prettierignore b/.prettierignore index e56ce5def..7e77bea2a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,3 +4,6 @@ pnpm-lock.yaml CHANGELOG.md apps/external/postcss.config.cjs + +apps/mobile/android +apps/mobile/ios diff --git a/.prettierrc.mjs b/.prettierrc.mjs index 1f8f25c7b..6eba02736 100644 --- a/.prettierrc.mjs +++ b/.prettierrc.mjs @@ -4,4 +4,5 @@ export default { printWidth: 100, tabWidth: 2, trailingComma: "all", + plugins: ["prettier-plugin-tailwindcss"], } diff --git a/.vscode/settings.json b/.vscode/settings.json index 523111761..ab2014bc7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,6 +13,8 @@ ["[a-zA-Z]+[cC]lass[nN]ame[\"'`]?:\\s*[\"'`]([^\"'`]*)[\"'`]", "([^\"'`]*)"], ["[a-zA-Z]+[cC]lass[nN]ame\\s*=\\s*[\"'`]([^\"'`]*)[\"'`]", "([^\"'`]*)"] ], + "typescript.tsserver.maxTsServerMemory": 8096, + "typescript.tsserver.nodePath": "node", // If you do not want to autofix some rules on save // You can put this in your user settings or workspace settings "eslint.codeActionsOnSave.rules": [ @@ -54,22 +56,6 @@ { "rule": "unused-imports/no-unused-imports", "severity": "off" - }, - { - "rule": "@typescript-eslint/require-await", - "severity": "info" - }, - { - "rule": "@typescript-eslint/await-thenable", - "severity": "info" - }, - { - "rule": "@typescript-eslint/no-floating-promises", - "severity": "info" - }, - { - "rule": "@typescript-eslint/no-misused-promises", - "severity": "info" } ], "cSpell.words": ["Hydable", "rsshub", "Русский"], diff --git a/CHANGELOG.md b/CHANGELOG.md index 657e1345f..585ff4ead 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -## [0.2.8-beta.0](https://github.com/RSSNext/follow/compare/v0.2.7-beta.0...v0.2.8-beta.0) (2024-12-19) +## [0.2.9-beta.0](https://github.com/RSSNext/follow/compare/v0.2.7-beta.0...v0.2.9-beta.0) (2024-12-26) ### Bug Fixes @@ -43,6 +43,7 @@ * audio cover style ([21a93c7](https://github.com/RSSNext/follow/commit/21a93c757dfbc161d67f28500f0129bde1959662)) * audio player on mobile ([1e936e2](https://github.com/RSSNext/follow/commit/1e936e2c593adafa92d54ddc542ff30688c0e3bc)) * audio player width, fixed [#1934](https://github.com/RSSNext/follow/issues/1934) ([238938a](https://github.com/RSSNext/follow/commit/238938a4da5b854f9f3422b93059b9f82f60d09b)) +* auth in electron ([405ee42](https://github.com/RSSNext/follow/commit/405ee42e8a1232424bb667cd56fffd3d0b463a4e)) * **auth:** handle optional icon class names for providers in login components ([de8d337](https://github.com/RSSNext/follow/commit/de8d3376713be0b696579e16395b887b2658d59f)) * **auth:** redirect url ([e7d5576](https://github.com/RSSNext/follow/commit/e7d5576b63a77cd4f4e25a3124f9685f408a73de)) * auto archived list flash ([#1269](https://github.com/RSSNext/follow/issues/1269)) ([8d2478c](https://github.com/RSSNext/follow/commit/8d2478c6a93aa9f5a99fddc55bbb8e532e1a0fe1)) @@ -60,6 +61,7 @@ * can not play bilibili video ([11ff813](https://github.com/RSSNext/follow/commit/11ff813c450fb519292b187a15236abe7d900abb)), closes [#1376](https://github.com/RSSNext/follow/issues/1376) * can not show context menu on subscription sheet ([0155792](https://github.com/RSSNext/follow/commit/0155792a38088e38bfe41b0cd10f062ac21e88a0)) * can not translate title by action ([ef68bae](https://github.com/RSSNext/follow/commit/ef68baeb29fbaba8a9d78a47656a8a7f852cc093)), closes [#1957](https://github.com/RSSNext/follow/issues/1957) +* can not update profile image, close [#2267](https://github.com/RSSNext/follow/issues/2267) ([d42f52d](https://github.com/RSSNext/follow/commit/d42f52d3f1af43ba91d129c586ffac47a2024da9)) * center dialog ([4a1ae06](https://github.com/RSSNext/follow/commit/4a1ae0668855b24513cf85b2a6527edf20c2da47)) * change invitation code placeholder font to theme font ([#1978](https://github.com/RSSNext/follow/issues/1978)) ([d78f7cd](https://github.com/RSSNext/follow/commit/d78f7cdc178388f5e0c83be4ce49e32f68863efa)) * changelog ([f84aa0b](https://github.com/RSSNext/follow/commit/f84aa0b0cfdc350f26e79ce68c75788cc090321d)) @@ -75,6 +77,7 @@ * clear selected feed ids when switching view ([c42cfdb](https://github.com/RSSNext/follow/commit/c42cfdb7db6fd2ac5722fe50006d7fd7675e17df)) * clear selection when pointer down, fixed [#1448](https://github.com/RSSNext/follow/issues/1448) ([33d3906](https://github.com/RSSNext/follow/commit/33d39067b5c5fdc8f302ca3ea13a740bbb014088)) * click outside to click area ([51194ac](https://github.com/RSSNext/follow/commit/51194aca6c51c9550703f416fa204f367d8a00de)) +* clicking a media should mark the social media item as read ([#2297](https://github.com/RSSNext/follow/issues/2297)) ([1b0f62f](https://github.com/RSSNext/follow/commit/1b0f62fbfe48fc5cea818fadac3c70f8f7b6d946)) * **cmdk:** change default cmdk search type to feed ([4a8fdea](https://github.com/RSSNext/follow/commit/4a8fdea84a4df90313f8c577d77d3944a34aa149)) * commands in action responsive ([ffca130](https://github.com/RSSNext/follow/commit/ffca1301b4f89a27b995b79b6e43d6b7f581e5c4)) * condition key ([ffb3b94](https://github.com/RSSNext/follow/commit/ffb3b943b0c502cf940d7f3c0d4d506489b65d37)) @@ -139,6 +142,7 @@ * feed icon margin right ([0f32364](https://github.com/RSSNext/follow/commit/0f3236406dc354adc9830c51e73f9fb4790f159a)) * feedIcon margin ([03ce13d](https://github.com/RSSNext/follow/commit/03ce13d45bd89908bd9bcb06484a07873b6388f5)) * fill height when zooming ([75e0da2](https://github.com/RSSNext/follow/commit/75e0da2a866a7789606bd40d484fc29973fd9e0a)) +* fill missing userId when open tip modal, close [#2248](https://github.com/RSSNext/follow/issues/2248) ([53ad291](https://github.com/RSSNext/follow/commit/53ad291820ccefc6badee8d3dc6af276c31c3cc6)) * filter no picture breaking logic ([9a84ed4](https://github.com/RSSNext/follow/commit/9a84ed40a16ea58c2c1cdc8cf9c46009fe46faea)) * float sidebar missing background ([b9982e0](https://github.com/RSSNext/follow/commit/b9982e0a6b44f476621daf30f93f8e740a544a02)) * follow external server fetch ua ([072dec0](https://github.com/RSSNext/follow/commit/072dec02b787bcdd8af7f5c0bf25398e2da8c15e)) @@ -171,17 +175,22 @@ * inline image style ([1d0eca1](https://github.com/RSSNext/follow/commit/1d0eca1ca16621634d0d0957b1d4d6c5f037498c)), closes [#1318](https://github.com/RSSNext/follow/issues/1318) * input and toast font style use user custom font ([#1322](https://github.com/RSSNext/follow/issues/1322)) ([c40becf](https://github.com/RSSNext/follow/commit/c40becff782e129c42984b354f2004b82c7f2615)) * lint ([dafaf0a](https://github.com/RSSNext/follow/commit/dafaf0a97d40a6df659a7869d7c11f5cf529dfe7)) +* list form width ([6487be1](https://github.com/RSSNext/follow/commit/6487be1c9f8c085f6722595d59f85d1176c503c5)) * list unread dot position ([dad33a1](https://github.com/RSSNext/follow/commit/dad33a12db4b270801da6b8c621b3049e6672c27)) * load dynamic render assets ([3499535](https://github.com/RSSNext/follow/commit/3499535b4091e3a82734c416528b0766e70f0b63)) * load instagram image fail ([f8fd58f](https://github.com/RSSNext/follow/commit/f8fd58f78ec11bc221eb9190ac7b6a66dd858f9c)), closes [#1539](https://github.com/RSSNext/follow/issues/1539) +* loading style in trending on mobile ([98beb0a](https://github.com/RSSNext/follow/commit/98beb0aee0a092bb696fda5d6d65b86c8ed5fee4)) * localeCompare is undefined ([ab28156](https://github.com/RSSNext/follow/commit/ab28156cb8bd998ec1bc6b43b9a44bd2ecd17137)) * lock ([97c1ece](https://github.com/RSSNext/follow/commit/97c1ece9e3d855c7dbcf7238e7953e9bd206811c)) * login override provider icon ([96b8929](https://github.com/RSSNext/follow/commit/96b892923ab1e791d29f0464b847a6873c61f075)) +* login page redirection ([fedf2af](https://github.com/RSSNext/follow/commit/fedf2af98459c5e0a50678fcc9923dc288190662)) * mark as read when navigating ([423777e](https://github.com/RSSNext/follow/commit/423777e1372631b8ea8d06913ce55fbdf97f1f07)) * mark feed unread dirty, refetch unread next time, fixed [#1830](https://github.com/RSSNext/follow/issues/1830) ([58d0e9c](https://github.com/RSSNext/follow/commit/58d0e9c1902157c2e9fb1444bc1c0db0b775485b)) * mark single feed as all read ([a4acd2f](https://github.com/RSSNext/follow/commit/a4acd2fb65335f228875ed5b38f03a9c71b76e1b)) +* max width for truncate ([6359c5b](https://github.com/RSSNext/follow/commit/6359c5b6f91e19b3d26f5cd195645e2c4522df53)) * md lint ([c8e556a](https://github.com/RSSNext/follow/commit/c8e556a3ac861cab4a4a7aff1aa2fa51aaca1f42)) * media item dot position on mobile ([c67248f](https://github.com/RSSNext/follow/commit/c67248ffc8d77cbdeac289f5ed398248dff41cb3)) +* **media:** adjust inline media size and alignment for better display [#2251](https://github.com/RSSNext/follow/issues/2251) ([#2254](https://github.com/RSSNext/follow/issues/2254)) ([86b5712](https://github.com/RSSNext/follow/commit/86b57120fca3aadcead672fb6e9ea470045b4759)) * missing site url in feed selector ([ea677ac](https://github.com/RSSNext/follow/commit/ea677ac6a3a43489a9508a32ecb22fa38ecf4f27)) * mobile need login modal ([0fb16f2](https://github.com/RSSNext/follow/commit/0fb16f2352e9776731522204b838be59f66127a4)) * mobile pop back to entry list will refresh data ([3c18768](https://github.com/RSSNext/follow/commit/3c18768968aeb4635933ae616c52de55b6fad2ab)) @@ -207,6 +216,7 @@ * optimize some styles ([9b99bf4](https://github.com/RSSNext/follow/commit/9b99bf4428cf6f1ca3218a3074a944af4d014f57)) * optimize the animation of the Follow button on the User Profile Modal ([#1156](https://github.com/RSSNext/follow/issues/1156)) ([87717d6](https://github.com/RSSNext/follow/commit/87717d642607cca4254f11d673a8a910fc6ab076)) * package export path for tsconfig ([#1690](https://github.com/RSSNext/follow/issues/1690)) ([00826ae](https://github.com/RSSNext/follow/commit/00826aecccac8dfcedba571ac02af1e3e1911c31)) +* parse auth cookie ([626db9a](https://github.com/RSSNext/follow/commit/626db9a7edf0d42208861c31c2083ab89a6e32c9)) * pass a component for Trans ([7d38cb6](https://github.com/RSSNext/follow/commit/7d38cb6d2f814d3b6012b66ba6024c05b6edcf2d)) * player cover height ([5486edd](https://github.com/RSSNext/follow/commit/5486eddd640bd5b72a174946ff804531e6e4b3d3)) * player margin safe ([1182497](https://github.com/RSSNext/follow/commit/1182497f6becb14a2954b079d9b47440ed071ef1)) @@ -259,6 +269,7 @@ * **server:** complie esmodule ([c438119](https://github.com/RSSNext/follow/commit/c438119ea8208f4da14da2294a381a6c34a14e25)) * **server:** serialize data ([2410b84](https://github.com/RSSNext/follow/commit/2410b843af3d16f77e88482d9c73f25c1dd3431a)) * **server:** use `xss` to serialize data ([93f58ec](https://github.com/RSSNext/follow/commit/93f58ecfd8fadfa67f56ebfe629e73f44bb94a49)) +* set cookie after signing in in electron ([55882ca](https://github.com/RSSNext/follow/commit/55882cacff2a6984555226f997dfacc966b27ac4)) * set referer ([29557f3](https://github.com/RSSNext/follow/commit/29557f370f37f7f5c7d1f7ccd7157a4449f7e5ca)) * set settings not ready ([0eef76b](https://github.com/RSSNext/follow/commit/0eef76bc916cdf8f3cc068a172b93ceb5ed194ba)) * set windows env ([1ea103b](https://github.com/RSSNext/follow/commit/1ea103b7ee1689ba9683c341a2afacacf2884fbd)) @@ -302,11 +313,13 @@ * translate form style ([6f3bb61](https://github.com/RSSNext/follow/commit/6f3bb61023dde1d58164425d8649c90bb4f680c6)), closes [#1184](https://github.com/RSSNext/follow/issues/1184) * **translations:** update zh-CN locale files for accuracy ([#1739](https://github.com/RSSNext/follow/issues/1739)) ([83c9f71](https://github.com/RSSNext/follow/commit/83c9f717dd7092dc4a4b1106961d746988066fd9)) * trending api based on language ([83ca873](https://github.com/RSSNext/follow/commit/83ca87349598acc361c8128bbcb014d89fcb56cf)) +* trending in mobile ([128c8ca](https://github.com/RSSNext/follow/commit/128c8ca44d059120e89fd40b4b0d76063114b30e)) * trial limit ([eee2bf8](https://github.com/RSSNext/follow/commit/eee2bf8771d2d30bba1f534984e3ca8d5e26cf04)) * try fix appImage icon config ([9d62c55](https://github.com/RSSNext/follow/commit/9d62c55d062044bfa008ff58872b26e8c9e76011)) * try fix dayjs init ([093f80d](https://github.com/RSSNext/follow/commit/093f80d9da223c567125285cc0f312f419bb4042)) * try fix float bar inset bottom ([3110f95](https://github.com/RSSNext/follow/commit/3110f953da896302a90bb65bd44de034fbb87ec4)) * try remove skeleton ([e0d9502](https://github.com/RSSNext/follow/commit/e0d9502b160928fa4d7b3fa870b948f17aa56eef)) +* try repositionInputs false ([1d0795b](https://github.com/RSSNext/follow/commit/1d0795bdb5ff147a295a08b7cf227e38084fe166)) * try stable sort result for feed list ([677b2ea](https://github.com/RSSNext/follow/commit/677b2ea214cc116b748879628a8745ca17609043)) * try to fix linux appImage icon ([c8db70b](https://github.com/RSSNext/follow/commit/c8db70b6ff953cfd006c2ff83c988bcb92ead358)) * ts import ([14311dd](https://github.com/RSSNext/follow/commit/14311dde0a9cb14e797e1a0f654a11f8502e58f8)) @@ -319,6 +332,7 @@ * **ui:** resolve conflict between video progress bar and swiper drag … ([#1337](https://github.com/RSSNext/follow/issues/1337)) ([aa9206f](https://github.com/RSSNext/follow/commit/aa9206f5b1e3ea0c008f912ef22cdaa406546251)) * **ui:** use safe inset top to fix windows overlays, fixed [#1184](https://github.com/RSSNext/follow/issues/1184) ([dc85570](https://github.com/RSSNext/follow/commit/dc855703289ac98db76f4a57760fcd66047b8dd1)) * **ui:** user profile follow button style ([d629215](https://github.com/RSSNext/follow/commit/d629215305a0ec9323dea0db929582e9609a82f6)) +* update ([8dbd700](https://github.com/RSSNext/follow/commit/8dbd7003d3261d6a229ddfe627cb0bbd6bef217c)) * update class names for responsive design and modify zh-HK ([#1782](https://github.com/RSSNext/follow/issues/1782)) ([70b46f5](https://github.com/RSSNext/follow/commit/70b46f57bf476df15216efd440899798e0e1fa0b)) * update daily claim amount reference in tooltip ([#1487](https://github.com/RSSNext/follow/issues/1487)) ([3792c2d](https://github.com/RSSNext/follow/commit/3792c2d850d9fc3f96ea4591784b61c631ee7e86)) * update electron to resolve present context menu ([2d31b64](https://github.com/RSSNext/follow/commit/2d31b646fd896e6ba55782c447b5d6ad9b327623)) @@ -378,6 +392,8 @@ * allow fille default title when editing feed ([495b29e](https://github.com/RSSNext/follow/commit/495b29e5898f18506577016dfe358f9c0add8035)), closes [#1503](https://github.com/RSSNext/follow/issues/1503) * and or condition for action ([#1616](https://github.com/RSSNext/follow/issues/1616)) ([4193a6b](https://github.com/RSSNext/follow/commit/4193a6b14d284a5e399fe94d9f305146179a75b4)) * **app:** support cache limit and clean cache ([dee294d](https://github.com/RSSNext/follow/commit/dee294dda589ca9e2eaee8a7e55197635b6323c7)) +* **auth:** add credential provider icon and update email translation in login flow ([d9a2638](https://github.com/RSSNext/follow/commit/d9a26387c5a5715dee6512a1d2f2aad92bf0e0eb)) +* **auth:** enhance login modal with email login ([8bf9dd0](https://github.com/RSSNext/follow/commit/8bf9dd07e52e7188abfce7de990fb8b93d45711c)) * bigger font size in mobile ([3e9a92d](https://github.com/RSSNext/follow/commit/3e9a92d16a80139c851671748367f009a3af4de9)) * bring rehypeUrlToAnchor back ([6f0cc4d](https://github.com/RSSNext/follow/commit/6f0cc4d566c9f2f552f0fedf1a8e570a817e0f56)), closes [#1373](https://github.com/RSSNext/follow/issues/1373) * copy button for ai summary ([b3ee572](https://github.com/RSSNext/follow/commit/b3ee5727e29d809092a8f4631d3e13c8d81095b9)) @@ -412,10 +428,13 @@ * List delete add secondary confirmation ([#1254](https://github.com/RSSNext/follow/issues/1254)) ([14f2bac](https://github.com/RSSNext/follow/commit/14f2bac8f3ba7e8f2dbd3958a4394c5b11ea2537)) * list preview ([ae390f7](https://github.com/RSSNext/follow/commit/ae390f7afabf3e312217bf13a175e2036c2c2763)) * load archived entries automatically ([5fe9e0c](https://github.com/RSSNext/follow/commit/5fe9e0c0e24460ca0fe435db03b753e9dcd3df17)) +* **locales:** enhance zh-HK translations ([#2208](https://github.com/RSSNext/follow/issues/2208)) ([2ecd89f](https://github.com/RSSNext/follow/commit/2ecd89ffde7a24580fb879192abdfa7ff95c6988)) +* **locales:** update zh-TW translations ([#2290](https://github.com/RSSNext/follow/issues/2290)) ([f734e6c](https://github.com/RSSNext/follow/commit/f734e6cfa3348f8906b48cbae8188531fd266e5e)) * manual action ([#1867](https://github.com/RSSNext/follow/issues/1867)) ([0eedbba](https://github.com/RSSNext/follow/commit/0eedbbadc263b474e2d4bfd5b6c498ac39c16c34)) * **mark-all-button:** add countdown to auto-confirm message ([#1414](https://github.com/RSSNext/follow/issues/1414)) ([e1a5fc6](https://github.com/RSSNext/follow/commit/e1a5fc63f20c941140071789c9b67685da19ea5c)) * merge redirect page into login page ([2fa16b7](https://github.com/RSSNext/follow/commit/2fa16b75d376fe04472e6c91675c67e725da8633)) * migrate to better auth ([#1951](https://github.com/RSSNext/follow/issues/1951)) ([9102203](https://github.com/RSSNext/follow/commit/910220395631bcf86f56bfc2b2168ac95852444c)) +* mobile app architecture and initial screens ([#2144](https://github.com/RSSNext/follow/issues/2144)) ([4b6a0fc](https://github.com/RSSNext/follow/commit/4b6a0fca2e3243061c7befc837e705262f17b664)) * mobile design ([#1568](https://github.com/RSSNext/follow/issues/1568)) ([edd4f9e](https://github.com/RSSNext/follow/commit/edd4f9e5a6dc041e9eae2cee5ddf4eb624527ef5)), closes [#1575](https://github.com/RSSNext/follow/issues/1575) * move feed to new category in context menu ([#2072](https://github.com/RSSNext/follow/issues/2072)) ([d684e14](https://github.com/RSSNext/follow/commit/d684e14056581744ac78ca697fa5ca059294245e)) * move hideExtraBadge ([2f14c30](https://github.com/RSSNext/follow/commit/2f14c30307a895bc866ac57989df1dc624eab4e6)) @@ -454,6 +473,7 @@ * update og image ([c58df35](https://github.com/RSSNext/follow/commit/c58df35d1f48e7374973a393c9b7efea38d12494)) * update og image ([142f9f5](https://github.com/RSSNext/follow/commit/142f9f57ce2697ab82fd5e1dd2cee7d0f7500721)) * update server hono ([5beaca3](https://github.com/RSSNext/follow/commit/5beaca3c772d7bc097fd53779c581eb6b41c9eaa)) +* update text ([8a666e5](https://github.com/RSSNext/follow/commit/8a666e5f1bf2a38f52463b569f6d627129f8812b)) * update text ([5aae827](https://github.com/RSSNext/follow/commit/5aae8273dcd999bc11904bc8c9d7b72e769fa200)) * update text ([89bef43](https://github.com/RSSNext/follow/commit/89bef43267199f60de376c3998d3cfff26faad23)) * update toast style ([cf5eeb6](https://github.com/RSSNext/follow/commit/cf5eeb63c488f9978f12659af59286315b768eea)) diff --git a/README.md b/README.md index 3f8996328..24c3bb2ac 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,9 @@ You can also install using the following methods maintained by our community: - If you are using Nix, you can install package [follow](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/fo/follow/package.nix) that maintained by [iosmanthus](https://github.com/iosmanthus). - If you are using macOS with [Homebrew](https://brew.sh), you can install cask [follow](https://formulae.brew.sh/cask/follow) (also [@alpha](https://formulae.brew.sh/cask/follow@alpha) and [@nightly](https://formulae.brew.sh/cask/follow@nightly)) that maintained by [realSunyz](https://github.com/realSunyz). -| [![Discord](https://img.shields.io/discord/1243823539426033696?color=5865F2&label=Discord&labelColor=black&logo=discord&logoColor=white&style=flat-square)](https://discord.gg/followapp) | Join our Discord server to connect with developers, request features, and receive support. | -| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------- | -| [![](https://img.shields.io/badge/any_text-Follow-blue?color=2CA5E0&label=_&logo=x&labelColor=black&style=flat-square)](https://x.com/intent/follow?screen_name=follow_app_) | Follow us on X/Twitter for product updates and to join in on reward activities. | +| [![Discord](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fdiscord.com%2Fapi%2Finvites%2Ffollowapp%3Fwith_counts%3Dtrue&query=approximate_member_count&color=5865F2&label=Discord&labelColor=black&logo=discord&logoColor=white&style=flat-square)](https://discord.gg/followapp) | Join our Discord server to connect with developers, request features, and receive support. | +| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------- | +| [![](https://img.shields.io/badge/any_text-Follow-blue?color=2CA5E0&label=_&logo=x&labelColor=black&style=flat-square)](https://x.com/intent/follow?screen_name=follow_app_) | Follow us on X/Twitter for product updates and to join in on reward activities. | > \[!IMPORTANT] > diff --git a/apps/main/src/index.ts b/apps/main/src/index.ts index a6ca124ba..e49b44a49 100644 --- a/apps/main/src/index.ts +++ b/apps/main/src/index.ts @@ -126,6 +126,36 @@ function bootstrap() { callback({ cancel: false, requestHeaders: details.requestHeaders }) }) + // handle session cookie when sign in with email in electron + session.defaultSession.webRequest.onHeadersReceived( + { + urls: [`${apiURL}/better-auth/sign-in/email?*`], + }, + (detail, callback) => { + const { responseHeaders } = detail + if (responseHeaders?.["set-cookie"]) { + const cookies = responseHeaders["set-cookie"] as string[] + cookies.forEach((cookie) => { + const cookieObj = parse(cookie) + Object.keys(cookieObj).forEach((name) => { + const value = cookieObj[name] + mainWindow.webContents.session.cookies.set({ + url: apiURL, + name, + value, + secure: true, + httpOnly: true, + domain: new URL(apiURL).hostname, + sameSite: "no_restriction", + }) + }) + }) + } + + callback({ cancel: false, responseHeaders }) + }, + ) + app.on("activate", () => { // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. diff --git a/apps/mobile/.env b/apps/mobile/.env new file mode 120000 index 000000000..c7360fb82 --- /dev/null +++ b/apps/mobile/.env @@ -0,0 +1 @@ +../../.env \ No newline at end of file diff --git a/apps/mobile/README.md b/apps/mobile/README.md new file mode 100644 index 000000000..cd4feb8a3 --- /dev/null +++ b/apps/mobile/README.md @@ -0,0 +1,50 @@ +# Welcome to your Expo app 👋 + +This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app). + +## Get started + +1. Install dependencies + + ```bash + npm install + ``` + +2. Start the app + + ```bash + npx expo start + ``` + +In the output, you'll find options to open the app in a + +- [development build](https://docs.expo.dev/develop/development-builds/introduction/) +- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/) +- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/) +- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo + +You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction). + +## Get a fresh project + +When you're ready, run: + +```bash +npm run reset-project +``` + +This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing. + +## Learn more + +To learn more about developing your project with Expo, look at the following resources: + +- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides). +- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web. + +## Join the community + +Join our community of developers creating universal apps. + +- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute. +- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions. diff --git a/apps/mobile/app.config.ts b/apps/mobile/app.config.ts new file mode 100644 index 000000000..95cfea0af --- /dev/null +++ b/apps/mobile/app.config.ts @@ -0,0 +1,97 @@ +import { resolve } from "node:path" + +import type { ConfigContext, ExpoConfig } from "expo/config" + +// const roundedIconPath = resolve(__dirname, "../../resources/icon.png") +const iconPath = resolve(__dirname, "./assets/icon.png") +const adaptiveIconPath = resolve(__dirname, "./assets/adaptive-icon.png") + +export default ({ config }: ConfigContext): ExpoConfig => ({ + ...config, + extra: { + eas: { + projectId: "a6335b14-fb84-45aa-ba80-6f6ab8926920", + }, + }, + owner: "follow", + updates: { + url: "https://u.expo.dev/a6335b14-fb84-45aa-ba80-6f6ab8926920", + }, + runtimeVersion: { + policy: "appVersion", + }, + + name: "Follow", + slug: "follow", + version: "1.0.0", + orientation: "portrait", + icon: iconPath, + scheme: "follow", + userInterfaceStyle: "automatic", + newArchEnabled: true, + ios: { + supportsTablet: true, + bundleIdentifier: "is.follow", + usesAppleSignIn: true, + infoPlist: { + LSApplicationCategoryType: "public.app-category.news", + }, + }, + android: { + package: "is.follow", + adaptiveIcon: { + foregroundImage: adaptiveIconPath, + backgroundColor: "#FF5C00", + }, + }, + web: { + bundler: "metro", + output: "static", + favicon: iconPath, + }, + plugins: [ + [ + "expo-router", + { + root: "./src/screens", + }, + ], + [ + "expo-splash-screen", + { + backgroundColor: "#ffffff", + dark: { + backgroundColor: "#000000", + }, + }, + ], + [ + "expo-font", + { + fonts: [ + "./assets/font/sn-pro/SNPro-Black.otf", + "./assets/font/sn-pro/SNPro-BlackItalic.otf", + "./assets/font/sn-pro/SNPro-Bold.otf", + "./assets/font/sn-pro/SNPro-BoldItalic.otf", + "./assets/font/sn-pro/SNPro-Heavy.otf", + "./assets/font/sn-pro/SNPro-HeavyItalic.otf", + "./assets/font/sn-pro/SNPro-Light.otf", + "./assets/font/sn-pro/SNPro-LightItalic.otf", + "./assets/font/sn-pro/SNPro-Medium.otf", + "./assets/font/sn-pro/SNPro-MediumItalic.otf", + "./assets/font/sn-pro/SNPro-Regular.otf", + "./assets/font/sn-pro/SNPro-RegularItalic.otf", + "./assets/font/sn-pro/SNPro-Semibold.otf", + "./assets/font/sn-pro/SNPro-SemiboldItalic.otf", + "./assets/font/sn-pro/SNPro-Thin.otf", + "./assets/font/sn-pro/SNPro-ThinItalic.otf", + ], + }, + ], + "expo-apple-authentication", + [require("./scripts/with-follow-assets.js")], + ], + experiments: { + typedRoutes: true, + }, +}) diff --git a/apps/mobile/assets/adaptive-icon.png b/apps/mobile/assets/adaptive-icon.png new file mode 100644 index 000000000..f0cf831f1 Binary files /dev/null and b/apps/mobile/assets/adaptive-icon.png differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-Black.otf b/apps/mobile/assets/font/sn-pro/SNPro-Black.otf new file mode 100644 index 000000000..d355197c5 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-Black.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-BlackItalic.otf b/apps/mobile/assets/font/sn-pro/SNPro-BlackItalic.otf new file mode 100644 index 000000000..396d9c0e6 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-BlackItalic.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-Bold.otf b/apps/mobile/assets/font/sn-pro/SNPro-Bold.otf new file mode 100644 index 000000000..0f7bdcb60 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-Bold.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-BoldItalic.otf b/apps/mobile/assets/font/sn-pro/SNPro-BoldItalic.otf new file mode 100644 index 000000000..721f48f47 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-BoldItalic.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-Book.otf b/apps/mobile/assets/font/sn-pro/SNPro-Book.otf new file mode 100644 index 000000000..a9f56b3b7 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-Book.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-BookItalic.otf b/apps/mobile/assets/font/sn-pro/SNPro-BookItalic.otf new file mode 100644 index 000000000..d3bc6cb36 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-BookItalic.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-Heavy.otf b/apps/mobile/assets/font/sn-pro/SNPro-Heavy.otf new file mode 100644 index 000000000..7df132536 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-Heavy.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-HeavyItalic.otf b/apps/mobile/assets/font/sn-pro/SNPro-HeavyItalic.otf new file mode 100644 index 000000000..33c151f4d Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-HeavyItalic.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-Light.otf b/apps/mobile/assets/font/sn-pro/SNPro-Light.otf new file mode 100644 index 000000000..dd8700d11 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-Light.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-LightItalic.otf b/apps/mobile/assets/font/sn-pro/SNPro-LightItalic.otf new file mode 100644 index 000000000..d6658004c Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-LightItalic.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-Medium.otf b/apps/mobile/assets/font/sn-pro/SNPro-Medium.otf new file mode 100644 index 000000000..df5c6d9e6 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-Medium.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-MediumItalic.otf b/apps/mobile/assets/font/sn-pro/SNPro-MediumItalic.otf new file mode 100644 index 000000000..da35d3cb1 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-MediumItalic.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-Regular.otf b/apps/mobile/assets/font/sn-pro/SNPro-Regular.otf new file mode 100644 index 000000000..39d81f36a Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-Regular.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-RegularItalic.otf b/apps/mobile/assets/font/sn-pro/SNPro-RegularItalic.otf new file mode 100644 index 000000000..c768aec69 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-RegularItalic.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-Semibold.otf b/apps/mobile/assets/font/sn-pro/SNPro-Semibold.otf new file mode 100644 index 000000000..3b83cd3eb Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-Semibold.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-SemiboldItalic.otf b/apps/mobile/assets/font/sn-pro/SNPro-SemiboldItalic.otf new file mode 100644 index 000000000..47a4b7cd8 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-SemiboldItalic.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-Thin.otf b/apps/mobile/assets/font/sn-pro/SNPro-Thin.otf new file mode 100644 index 000000000..ec723c941 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-Thin.otf differ diff --git a/apps/mobile/assets/font/sn-pro/SNPro-ThinItalic.otf b/apps/mobile/assets/font/sn-pro/SNPro-ThinItalic.otf new file mode 100644 index 000000000..b23046af4 Binary files /dev/null and b/apps/mobile/assets/font/sn-pro/SNPro-ThinItalic.otf differ diff --git a/apps/mobile/assets/icon.png b/apps/mobile/assets/icon.png new file mode 100644 index 000000000..a99d48fa1 Binary files /dev/null and b/apps/mobile/assets/icon.png differ diff --git a/apps/mobile/babel.config.js b/apps/mobile/babel.config.js new file mode 100644 index 000000000..012481e1e --- /dev/null +++ b/apps/mobile/babel.config.js @@ -0,0 +1,21 @@ +const path = require("node:path") + +module.exports = function (api) { + api.cache(true) + return { + presets: [["babel-preset-expo", { jsxImportSource: "nativewind" }], "nativewind/babel"], + plugins: [ + ["inline-import", { extensions: [".sql"] }], + [ + "module-resolver", + { + alias: { + "es-toolkit": path.resolve(__dirname, "../../node_modules/es-toolkit/dist/index.js"), + }, + extensions: [".js", ".jsx", ".ts", ".tsx"], + }, + ], + "react-native-reanimated/plugin", + ], + } +} diff --git a/apps/mobile/drizzle.config.ts b/apps/mobile/drizzle.config.ts new file mode 100644 index 000000000..c634f89b3 --- /dev/null +++ b/apps/mobile/drizzle.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "drizzle-kit" + +export default defineConfig({ + dialect: "sqlite", + driver: "expo", + schema: "./src/database/schemas/index.ts", + out: "./drizzle", +}) diff --git a/apps/mobile/drizzle/0000_harsh_shiva.sql b/apps/mobile/drizzle/0000_harsh_shiva.sql new file mode 100644 index 000000000..a988d078a --- /dev/null +++ b/apps/mobile/drizzle/0000_harsh_shiva.sql @@ -0,0 +1,43 @@ +CREATE TABLE `feeds` ( + `id` text PRIMARY KEY NOT NULL, + `title` text, + `url` text NOT NULL, + `description` text, + `image` text, + `error_at` text, + `site_url` text, + `owner_user_id` text, + `error_message` text +); +--> statement-breakpoint +CREATE TABLE `inboxes` ( + `id` text PRIMARY KEY NOT NULL, + `user_id` text NOT NULL, + `title` text +); +--> statement-breakpoint +CREATE TABLE `lists` ( + `id` text PRIMARY KEY NOT NULL, + `user_id` text NOT NULL, + `title` text NOT NULL, + `feed_ids` text, + `description` text, + `view` integer NOT NULL, + `image` text, + `fee` integer, + `owner_user_id` text +); +--> statement-breakpoint +CREATE TABLE `subscriptions` ( + `feed_id` text, + `list_id` text, + `inbox_id` text, + `user_id` text NOT NULL, + `view` integer NOT NULL, + `is_private` integer NOT NULL, + `title` text, + `category` text, + `created_at` text, + `type` text NOT NULL, + `id` text PRIMARY KEY NOT NULL +); diff --git a/apps/mobile/drizzle/0001_bored_hobgoblin.sql b/apps/mobile/drizzle/0001_bored_hobgoblin.sql new file mode 100644 index 000000000..d2f5b5e53 --- /dev/null +++ b/apps/mobile/drizzle/0001_bored_hobgoblin.sql @@ -0,0 +1 @@ +ALTER TABLE `inboxes` DROP COLUMN `user_id`; \ No newline at end of file diff --git a/apps/mobile/drizzle/0002_smart_power_man.sql b/apps/mobile/drizzle/0002_smart_power_man.sql new file mode 100644 index 000000000..256e69246 --- /dev/null +++ b/apps/mobile/drizzle/0002_smart_power_man.sql @@ -0,0 +1,5 @@ +CREATE TABLE `unread` ( + `id` text PRIMARY KEY NOT NULL, + `subscription_id` text NOT NULL, + `count` integer NOT NULL +); diff --git a/apps/mobile/drizzle/0003_known_roland_deschain.sql b/apps/mobile/drizzle/0003_known_roland_deschain.sql new file mode 100644 index 000000000..ed751f077 --- /dev/null +++ b/apps/mobile/drizzle/0003_known_roland_deschain.sql @@ -0,0 +1,10 @@ +PRAGMA foreign_keys=OFF;--> statement-breakpoint +CREATE TABLE `__new_unread` ( + `subscription_id` text PRIMARY KEY NOT NULL, + `count` integer NOT NULL +); +--> statement-breakpoint +INSERT INTO `__new_unread`("subscription_id", "count") SELECT "subscription_id", "count" FROM `unread`;--> statement-breakpoint +DROP TABLE `unread`;--> statement-breakpoint +ALTER TABLE `__new_unread` RENAME TO `unread`;--> statement-breakpoint +PRAGMA foreign_keys=ON; \ No newline at end of file diff --git a/apps/mobile/drizzle/0004_majestic_thunderbolt_ross.sql b/apps/mobile/drizzle/0004_majestic_thunderbolt_ross.sql new file mode 100644 index 000000000..fb381bdc7 --- /dev/null +++ b/apps/mobile/drizzle/0004_majestic_thunderbolt_ross.sql @@ -0,0 +1,8 @@ +CREATE TABLE `users` ( + `id` text PRIMARY KEY NOT NULL, + `email` text NOT NULL, + `handle` text, + `name` text, + `image` text, + `is_me` integer NOT NULL +); diff --git a/apps/mobile/drizzle/meta/0000_snapshot.json b/apps/mobile/drizzle/meta/0000_snapshot.json new file mode 100644 index 000000000..8c4e5c5f3 --- /dev/null +++ b/apps/mobile/drizzle/meta/0000_snapshot.json @@ -0,0 +1,282 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "f277136a-3ff5-4d70-8509-c1f40f0aa4ca", + "prevId": "00000000-0000-0000-0000-000000000000", + "tables": { + "feeds": { + "name": "feeds", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error_at": { + "name": "error_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_url": { + "name": "site_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "owner_user_id": { + "name": "owner_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error_message": { + "name": "error_message", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inboxes": { + "name": "inboxes", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lists": { + "name": "lists", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "feed_ids": { + "name": "feed_ids", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "view": { + "name": "view", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fee": { + "name": "fee", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "owner_user_id": { + "name": "owner_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "subscriptions": { + "name": "subscriptions", + "columns": { + "feed_id": { + "name": "feed_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "list_id": { + "name": "list_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "inbox_id": { + "name": "inbox_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "view": { + "name": "view", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "is_private": { + "name": "is_private", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + } +} diff --git a/apps/mobile/drizzle/meta/0001_snapshot.json b/apps/mobile/drizzle/meta/0001_snapshot.json new file mode 100644 index 000000000..89cde8e82 --- /dev/null +++ b/apps/mobile/drizzle/meta/0001_snapshot.json @@ -0,0 +1,275 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "03bb7af3-104a-4220-aa4d-46abfac83303", + "prevId": "f277136a-3ff5-4d70-8509-c1f40f0aa4ca", + "tables": { + "feeds": { + "name": "feeds", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error_at": { + "name": "error_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_url": { + "name": "site_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "owner_user_id": { + "name": "owner_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error_message": { + "name": "error_message", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inboxes": { + "name": "inboxes", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lists": { + "name": "lists", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "feed_ids": { + "name": "feed_ids", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "view": { + "name": "view", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fee": { + "name": "fee", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "owner_user_id": { + "name": "owner_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "subscriptions": { + "name": "subscriptions", + "columns": { + "feed_id": { + "name": "feed_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "list_id": { + "name": "list_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "inbox_id": { + "name": "inbox_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "view": { + "name": "view", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "is_private": { + "name": "is_private", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + } +} diff --git a/apps/mobile/drizzle/meta/0002_snapshot.json b/apps/mobile/drizzle/meta/0002_snapshot.json new file mode 100644 index 000000000..eb2b39402 --- /dev/null +++ b/apps/mobile/drizzle/meta/0002_snapshot.json @@ -0,0 +1,306 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "38eb9a81-9c8d-4f2f-8c98-8f065decf7ed", + "prevId": "03bb7af3-104a-4220-aa4d-46abfac83303", + "tables": { + "feeds": { + "name": "feeds", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error_at": { + "name": "error_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_url": { + "name": "site_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "owner_user_id": { + "name": "owner_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error_message": { + "name": "error_message", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inboxes": { + "name": "inboxes", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lists": { + "name": "lists", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "feed_ids": { + "name": "feed_ids", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "view": { + "name": "view", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fee": { + "name": "fee", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "owner_user_id": { + "name": "owner_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "subscriptions": { + "name": "subscriptions", + "columns": { + "feed_id": { + "name": "feed_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "list_id": { + "name": "list_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "inbox_id": { + "name": "inbox_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "view": { + "name": "view", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "is_private": { + "name": "is_private", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "unread": { + "name": "unread", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + } +} diff --git a/apps/mobile/drizzle/meta/0003_snapshot.json b/apps/mobile/drizzle/meta/0003_snapshot.json new file mode 100644 index 000000000..2039facec --- /dev/null +++ b/apps/mobile/drizzle/meta/0003_snapshot.json @@ -0,0 +1,299 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "b74f8057-78c5-4675-94dd-e41d94674ef7", + "prevId": "38eb9a81-9c8d-4f2f-8c98-8f065decf7ed", + "tables": { + "feeds": { + "name": "feeds", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error_at": { + "name": "error_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_url": { + "name": "site_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "owner_user_id": { + "name": "owner_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error_message": { + "name": "error_message", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inboxes": { + "name": "inboxes", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lists": { + "name": "lists", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "feed_ids": { + "name": "feed_ids", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "view": { + "name": "view", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fee": { + "name": "fee", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "owner_user_id": { + "name": "owner_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "subscriptions": { + "name": "subscriptions", + "columns": { + "feed_id": { + "name": "feed_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "list_id": { + "name": "list_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "inbox_id": { + "name": "inbox_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "view": { + "name": "view", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "is_private": { + "name": "is_private", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "unread": { + "name": "unread", + "columns": { + "subscription_id": { + "name": "subscription_id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + } +} diff --git a/apps/mobile/drizzle/meta/0004_snapshot.json b/apps/mobile/drizzle/meta/0004_snapshot.json new file mode 100644 index 000000000..69fe91979 --- /dev/null +++ b/apps/mobile/drizzle/meta/0004_snapshot.json @@ -0,0 +1,351 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "fc790c48-4ade-4648-a1b4-0a3e9faf65c5", + "prevId": "b74f8057-78c5-4675-94dd-e41d94674ef7", + "tables": { + "feeds": { + "name": "feeds", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error_at": { + "name": "error_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_url": { + "name": "site_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "owner_user_id": { + "name": "owner_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error_message": { + "name": "error_message", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "inboxes": { + "name": "inboxes", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "lists": { + "name": "lists", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "feed_ids": { + "name": "feed_ids", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "view": { + "name": "view", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fee": { + "name": "fee", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "owner_user_id": { + "name": "owner_user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "subscriptions": { + "name": "subscriptions", + "columns": { + "feed_id": { + "name": "feed_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "list_id": { + "name": "list_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "inbox_id": { + "name": "inbox_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "view": { + "name": "view", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "is_private": { + "name": "is_private", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "unread": { + "name": "unread", + "columns": { + "subscription_id": { + "name": "subscription_id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "users": { + "name": "users", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "handle": { + "name": "handle", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "is_me": { + "name": "is_me", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + } +} diff --git a/apps/mobile/drizzle/meta/_journal.json b/apps/mobile/drizzle/meta/_journal.json new file mode 100644 index 000000000..1a807c5b3 --- /dev/null +++ b/apps/mobile/drizzle/meta/_journal.json @@ -0,0 +1,41 @@ +{ + "version": "7", + "dialect": "sqlite", + "entries": [ + { + "idx": 0, + "version": "6", + "when": 1734622443265, + "tag": "0000_harsh_shiva", + "breakpoints": true + }, + { + "idx": 1, + "version": "6", + "when": 1734622716320, + "tag": "0001_bored_hobgoblin", + "breakpoints": true + }, + { + "idx": 2, + "version": "6", + "when": 1734962295258, + "tag": "0002_smart_power_man", + "breakpoints": true + }, + { + "idx": 3, + "version": "6", + "when": 1734963906590, + "tag": "0003_known_roland_deschain", + "breakpoints": true + }, + { + "idx": 4, + "version": "6", + "when": 1735137187415, + "tag": "0004_majestic_thunderbolt_ross", + "breakpoints": true + } + ] +} diff --git a/apps/mobile/drizzle/migrations.js b/apps/mobile/drizzle/migrations.js new file mode 100644 index 000000000..70c732a84 --- /dev/null +++ b/apps/mobile/drizzle/migrations.js @@ -0,0 +1,19 @@ +// This file is required for Expo/React Native SQLite migrations - https://orm.drizzle.team/quick-sqlite/expo + +import m0000 from "./0000_harsh_shiva.sql" +import m0001 from "./0001_bored_hobgoblin.sql" +import m0002 from "./0002_smart_power_man.sql" +import m0003 from "./0003_known_roland_deschain.sql" +import m0004 from "./0004_majestic_thunderbolt_ross.sql" +import journal from "./meta/_journal.json" + +export default { + journal, + migrations: { + m0000, + m0001, + m0002, + m0003, + m0004, + }, +} diff --git a/apps/mobile/eas.json b/apps/mobile/eas.json new file mode 100644 index 000000000..fcb962cc0 --- /dev/null +++ b/apps/mobile/eas.json @@ -0,0 +1,24 @@ +{ + "cli": { + "appVersionSource": "remote" + }, + "build": { + "preview": { + "channel": "preview", + "distribution": "internal" + }, + "production": { + "channel": "production", + "autoIncrement": true + } + }, + "submit": { + "production": { + "ios": { + "appleId": "rss3@diygod.me", + "ascAppId": "6739802604", + "appleTeamId": "NCLY2BLCL2" + } + } + } +} diff --git a/apps/mobile/metro.config.js b/apps/mobile/metro.config.js new file mode 100644 index 000000000..857e635c2 --- /dev/null +++ b/apps/mobile/metro.config.js @@ -0,0 +1,10 @@ +const { getDefaultConfig } = require("expo/metro-config") +const { withNativeWind } = require("nativewind/metro") +const { wrapWithReanimatedMetroConfig } = require("react-native-reanimated/metro-config") + +const config = getDefaultConfig(__dirname, { isCSSEnabled: true }) +config.resolver.sourceExts.push("sql") + +module.exports = wrapWithReanimatedMetroConfig( + withNativeWind(config, { input: "./src/global.css" }), +) diff --git a/apps/mobile/nativewind-env.d.ts b/apps/mobile/nativewind-env.d.ts new file mode 100644 index 000000000..958346287 --- /dev/null +++ b/apps/mobile/nativewind-env.d.ts @@ -0,0 +1,3 @@ +/// + +// NOTE: This file should not be edited and should be committed with your source code. It is generated by NativeWind. diff --git a/apps/mobile/package.json b/apps/mobile/package.json new file mode 100644 index 000000000..080dd3350 --- /dev/null +++ b/apps/mobile/package.json @@ -0,0 +1,88 @@ +{ + "name": "@follow/mobile", + "version": "1.0.0", + "private": true, + "main": "src/main.ts", + "scripts": { + "android": "expo run:android", + "db:generate": "drizzle-kit generate", + "dev": "npm run start", + "ios": "expo run:ios", + "ios:device": "expo run:ios --device", + "lint": "expo lint", + "start": "expo start --dev-client", + "web": "expo start --web" + }, + "dependencies": { + "@better-auth/expo": "1.0.23-beta.2", + "@expo/vector-icons": "^14.0.2", + "@follow/constants": "workspace:*", + "@follow/hooks": "workspace:*", + "@follow/shared": "workspace:*", + "@follow/utils": "workspace:*", + "@hookform/resolvers": "3.9.1", + "@react-native-cookies/cookies": "^6.2.1", + "@react-navigation/bottom-tabs": "^7.0.0", + "@react-navigation/native": "^7.0.0", + "@shopify/flash-list": "1.7.1", + "@tanstack/react-query": "5.62.3", + "better-auth": "1.1.3", + "cookie-es": "^1.2.2", + "dayjs": "1.11.13", + "expo": "52.0.18", + "expo-apple-authentication": "~7.1.2", + "expo-blur": "~14.0.1", + "expo-build-properties": "^0.13.1", + "expo-clipboard": "~7.0.0", + "expo-constants": "~17.0.3", + "expo-file-system": "~18.0.6", + "expo-font": "~13.0.1", + "expo-haptics": "~14.0.0", + "expo-linear-gradient": "~14.0.1", + "expo-linking": "~7.0.3", + "expo-router": "4.0.11", + "expo-sharing": "~13.0.0", + "expo-splash-screen": "~0.29.18", + "expo-sqlite": "15.0.3", + "expo-status-bar": "~2.0.0", + "expo-symbols": "~0.2.0", + "expo-system-ui": "~4.0.6", + "expo-updates": "~0.26.10", + "expo-web-browser": "~14.0.1", + "hono": "4.6.13", + "immer": "10.1.1", + "jotai": "2.10.3", + "nativewind": "4.1.23", + "ofetch": "1.4.1", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-hook-form": "7.54.0", + "react-native": "0.76.5", + "react-native-context-menu-view": "1.16.0", + "react-native-gesture-handler": "~2.20.2", + "react-native-keyboard-controller": "^1.15.0", + "react-native-pager-view": "6.6.1", + "react-native-reanimated": "~3.16.5", + "react-native-safe-area-context": "4.12.0", + "react-native-screens": "~4.1.0", + "react-native-svg": "15.8.0", + "react-native-web": "~0.19.13", + "react-native-webview": "13.12.5", + "swiftui-react-native": "6.3.3", + "tailwindcss": "3.4.16", + "usehooks-ts": "3.1.0", + "zod": "3.23.8", + "zustand": "5.0.2" + }, + "devDependencies": { + "@babel/core": "^7.25.2", + "@types/react": "^18.3.12", + "@types/react-test-renderer": "^18.3.0", + "babel-plugin-inline-import": "3.0.0", + "babel-plugin-module-resolver": "5.0.2", + "drizzle-kit": "0.30.1", + "eas-cli": "14.2.0", + "expo-drizzle-studio-plugin": "0.1.1", + "react-test-renderer": "18.3.1" + } +} diff --git a/apps/mobile/scripts/with-follow-assets.js b/apps/mobile/scripts/with-follow-assets.js new file mode 100644 index 000000000..5dab2d339 --- /dev/null +++ b/apps/mobile/scripts/with-follow-assets.js @@ -0,0 +1,112 @@ +/* + * If you add an asset you need to run `npx expo prebuild` + * If you rename or delete an asset you need to run `npx expo prebuild --clean` to delete them in your android and ios folder as well. + * + * This plugin is inspired by the following plugins: + * - [expo-custom-assets](https://github.com/Malaa-tech/expo-custom-assets) + * - [spacedrive](https://github.com/spacedriveapp/spacedrive/blob/main/apps/mobile/scripts/withRiveAssets.js) + */ + +const { withDangerousMod, withXcodeProject, IOSConfig } = require("@expo/config-plugins") +const fs = require("node:fs") +const path = require("node:path") +const { execSync } = require("node:child_process") +const process = require("node:process") + +const followRoot = path.resolve(__dirname, "..", "..", "..") + +// Specify the source directory of your assets +const ASSET_SOURCE_DIR = path.join("out", "rn-web") + +const IOS_GROUP_NAME = "Assets" + +const isAssetReady = () => { + return fs.existsSync(path.resolve(followRoot, ASSET_SOURCE_DIR)) +} + +const withFollowAssets = (config) => { + if (!isAssetReady()) { + console.info( + "Assets source directory not found! Running `pnpm build:rn-web` to generate assets.", + ) + process.chdir(followRoot) + execSync("pnpm build:rn-web") + process.chdir(__dirname) + } + if (!isAssetReady()) { + throw new Error("Assets source directory not found! Please make sure the build is successful.") + } + config = addAndroidResources(config) + config = addIOSResources(config) + return config +} + +// Code inspired by https://github.com/rive-app/rive-react-native/issues/185#issuecomment-1593396573 +function addAndroidResources(config) { + return withDangerousMod(config, [ + "android", + async (config) => { + // Get the path to the Android project directory + const { projectRoot } = config.modRequest + + // Get the path to the Android resources directory + const resDir = path.join(projectRoot, "android", "app", "src", "main", "res") + + // Create the 'raw' directory if it doesn't exist + const rawDir = path.join(resDir, "raw") + fs.mkdirSync(rawDir, { recursive: true }) + + // Get the path to the assets directory + const assetSourcePath = path.join(followRoot, ASSET_SOURCE_DIR) + + // Retrieve all files in the assets directory + // const assetFiles = fs.readdirSync(assetSourcePath) + + // Move asset file to the resources 'raw' directory + fs.cpSync(assetSourcePath, rawDir, { recursive: true }) + + // Move each asset file to the resources 'raw' directory + // for (const assetFile of assetFiles) { + // const srcAssetPath = path.join(assetSourcePath, assetFile) + // const destAssetPath = path.join(rawDir, assetFile) + // fs.copyFileSync(srcAssetPath, destAssetPath) + // } + + return config + }, + ]) +} + +// Code inspired by https://github.com/expo/expo/blob/61f8cf8d4b3cf5f8bf61f346476ebdb4aff40545/packages/expo-font/plugin/src/withFontsIos.ts +function addIOSResources(config) { + return withXcodeProject(config, async (config) => { + const project = config.modResults + const { platformProjectRoot } = config.modRequest + + // Create Assets group in project + IOSConfig.XcodeUtils.ensureGroupRecursively(project, IOS_GROUP_NAME) + + // Get filepaths + const assetSourcePath = path.resolve(followRoot, ASSET_SOURCE_DIR) + + // Add assets to group + addIOSResourceFile(project, platformProjectRoot, [assetSourcePath]) + + return config + }) + + function addIOSResourceFile(project, platformRoot, assetFilesPaths) { + for (const assetFile of assetFilesPaths) { + const riveFilePath = path.relative(platformRoot, assetFile) + IOSConfig.XcodeUtils.addResourceFileToGroup({ + filepath: riveFilePath, + groupName: IOS_GROUP_NAME, + project, + isBuildFile: true, + verbose: true, + }) + } + } +} + +module.exports = withFollowAssets diff --git a/apps/mobile/shim-env.d.ts b/apps/mobile/shim-env.d.ts new file mode 100644 index 000000000..847b46fe8 --- /dev/null +++ b/apps/mobile/shim-env.d.ts @@ -0,0 +1,5 @@ +/// + +declare namespace NodeJS { + export type ProcessEnv = Record +} diff --git a/apps/mobile/src/atoms/env.ts b/apps/mobile/src/atoms/env.ts new file mode 100644 index 000000000..dea86e6ba --- /dev/null +++ b/apps/mobile/src/atoms/env.ts @@ -0,0 +1,11 @@ +import { createAtomHooks } from "@follow/utils" +import { atomWithStorage } from "jotai/utils" + +import { JotaiPersistSyncStorage } from "../lib/jotai" + +type Environment = "prod" | "dev" | "staging" +export const [, , useEnvironment, , getEnvironment, setEnvironment] = createAtomHooks( + atomWithStorage("debug-env", "prod", JotaiPersistSyncStorage, { + getOnInit: true, + }), +) diff --git a/apps/mobile/src/components/common/FollowWebView.tsx b/apps/mobile/src/components/common/FollowWebView.tsx new file mode 100644 index 000000000..3c2bf39a5 --- /dev/null +++ b/apps/mobile/src/components/common/FollowWebView.tsx @@ -0,0 +1,165 @@ +import { callWebviewExpose } from "@follow/shared" +import { parseSafeUrl, transformVideoUrl } from "@follow/utils" +import * as Linking from "expo-linking" +import type { RefObject } from "react" +import { useCallback, useEffect, useState } from "react" +import { Platform } from "react-native" +import type { WebViewNavigation, WebViewProps } from "react-native-webview" +import { WebView } from "react-native-webview" + +import { signOut } from "@/src/lib/auth" +import { useOpenLink } from "@/src/lib/hooks/useOpenLink" + +const presetUri = Platform.select({ + ios: "rn-web/index.html", + android: "file:///android_asset/raw/index.html", + default: "https://app.follow.is", +}) + +const allowHosts = new Set(["app.follow.is"]) + +interface FollowWebViewProps extends WebViewProps { + customUrl?: string +} + +const injectedJavaScript = [ + `window.__RN__ = true`, + // TODO use more reliable way to detect the page is ready + `window.setTimeout(() => window.ReactNativeWebView.postMessage("ready"), 2000)`, +].join(";") + +const styles = { + // https://github.com/react-native-webview/react-native-webview/issues/318#issuecomment-503979211 + webview: { backgroundColor: "transparent" }, + webviewContainer: { width: "100%" }, +} as const + +export const FollowWebView = ({ + webViewRef, + customUrl, + ...props +}: { webViewRef: RefObject } & FollowWebViewProps) => { + const { onNavigationStateChange } = useWebViewNavigation({ webViewRef }) + const [ready, setReady] = useState(false) + useDeepLink({ webViewRef, ready }) + + return ( + setReady(false)} + // onLoadProgress={({ nativeEvent }) => setProgress(nativeEvent.progress)} + onError={(e) => { + console.error("WebView error:", e) + }} + onContentProcessDidTerminate={() => webViewRef.current?.reload()} + onMessage={(e) => { + const message = e.nativeEvent.data + if (message === "sign-out") { + signOut() + return + } + if (message === "ready") { + setReady(true) + return + } + }} + {...props} + /> + ) +} + +const useWebViewNavigation = ({ webViewRef }: { webViewRef: RefObject }) => { + const openLink = useOpenLink() + + const onNavigationStateChange = useCallback( + (newNavState: WebViewNavigation) => { + const { url: urlStr } = newNavState + const url = parseSafeUrl(urlStr) + if (!url) return + if (url.protocol === "file:") return + if (allowHosts.has(url.host)) return + + webViewRef.current?.stopLoading() + + const formattedUrl = transformVideoUrl({ url: urlStr }) + if (formattedUrl) { + openLink(formattedUrl) + return + } + openLink(urlStr) + }, + [openLink, webViewRef], + ) + + return { onNavigationStateChange } +} + +// We only need to handle deep link at the first time the app is opened +let lastInitialUrl: string | null = null +const useDeepLink = ({ + webViewRef, + ready = true, +}: { + webViewRef: RefObject + ready?: boolean +}) => { + const handleDeepLink = useCallback( + async (url: string) => { + const { queryParams } = Linking.parse(url) + if (!queryParams) { + console.error("Invalid URL! queryParams is not available", url) + return + } + const id = queryParams["id"] ?? undefined + const isList = queryParams["type"] === "list" + // const urlParam = queryParams["url"] ?? undefined + if (!id || typeof id !== "string") { + console.error("Invalid URL! id is not a string", url) + return + } + const injectJavaScript = webViewRef.current?.injectJavaScript + if (!injectJavaScript) { + console.error("injectJavaScript is not available") + return + } + callWebviewExpose(injectJavaScript).follow({ id, isList }) + }, + [webViewRef], + ) + + // https://reactnative.dev/docs/linking#handling-deep-links + // + // The handler added with Linking.addEventListener() is only triggered when app is already open. + // + // When the app is not already open and the deep link triggered app launch, + // the URL can be obtained with Linking.getInitialURL(). + useEffect(() => { + if (!ready) return + + const getUrlAsync = async () => { + const initialUrl = await Linking.getInitialURL() + if (!initialUrl) return + if (initialUrl === lastInitialUrl) return + lastInitialUrl = initialUrl + handleDeepLink(initialUrl) + } + getUrlAsync() + // eslint-disable-next-line @eslint-react/web-api/no-leaked-event-listener + const deepLinkListener = Linking.addEventListener("url", (event: { url: string }) => { + handleDeepLink(event.url) + }) + return () => deepLinkListener.remove() + }, [handleDeepLink, ready]) +} diff --git a/apps/mobile/src/components/common/HeaderBlur.tsx b/apps/mobile/src/components/common/HeaderBlur.tsx new file mode 100644 index 000000000..8f89b60d6 --- /dev/null +++ b/apps/mobile/src/components/common/HeaderBlur.tsx @@ -0,0 +1,16 @@ +import { StyleSheet } from "react-native" + +import { ThemedBlurView } from "@/src/components/common/ThemedBlurView" + +const node = ( + +) +export const HeaderBlur = () => { + return node +} diff --git a/apps/mobile/src/components/common/ThemedBlurView.tsx b/apps/mobile/src/components/common/ThemedBlurView.tsx new file mode 100644 index 000000000..9a7843ab0 --- /dev/null +++ b/apps/mobile/src/components/common/ThemedBlurView.tsx @@ -0,0 +1,14 @@ +import type { BlurViewProps } from "expo-blur" +import { BlurView } from "expo-blur" +import { useColorScheme } from "nativewind" +import type { FC } from "react" + +export const ThemedBlurView: FC = ({ tint, ...rest }) => { + const { colorScheme } = useColorScheme() + return ( + + ) +} diff --git a/apps/mobile/src/components/common/ThemedText.tsx b/apps/mobile/src/components/common/ThemedText.tsx new file mode 100644 index 000000000..d10df5793 --- /dev/null +++ b/apps/mobile/src/components/common/ThemedText.tsx @@ -0,0 +1,6 @@ +import type { TextProps } from "react-native" +import { Text } from "react-native" + +export function ThemedText(props: TextProps) { + return +} diff --git a/apps/mobile/src/components/ui/accordion/index.tsx b/apps/mobile/src/components/ui/accordion/index.tsx new file mode 100644 index 000000000..9866871ec --- /dev/null +++ b/apps/mobile/src/components/ui/accordion/index.tsx @@ -0,0 +1,65 @@ +import type { StyleProp, ViewStyle } from "react-native" +import { StyleSheet, View } from "react-native" +import type { SharedValue } from "react-native-reanimated" +import Animated, { + useAnimatedStyle, + useDerivedValue, + useSharedValue, + withSpring, +} from "react-native-reanimated" + +export function AccordionItem({ + isExpanded, + children, + viewKey, + style, + wrapperStyle, + wrapperClassName, +}: { + isExpanded: SharedValue + children: React.ReactNode + viewKey: string + style?: StyleProp + wrapperStyle?: StyleProp + wrapperClassName?: string + duration?: number +}) { + const height = useSharedValue(0) + + const derivedHeight = useDerivedValue(() => + withSpring(height.value * Number(isExpanded.value), { + damping: 30, + stiffness: 100, + }), + ) + const bodyStyle = useAnimatedStyle(() => ({ + height: derivedHeight.value, + })) + + return ( + + { + height.value = e.nativeEvent.layout.height + }} + style={[styles.wrapper, wrapperStyle]} + className={wrapperClassName} + > + {children} + + + ) +} + +const styles = StyleSheet.create({ + wrapper: { + width: "100%", + position: "absolute", + display: "flex", + flex: 1, + }, + animatedView: { + width: "100%", + overflow: "hidden", + }, +}) diff --git a/apps/mobile/src/components/ui/context-menu/index.android.tsx b/apps/mobile/src/components/ui/context-menu/index.android.tsx new file mode 100644 index 000000000..f36d0b7e6 --- /dev/null +++ b/apps/mobile/src/components/ui/context-menu/index.android.tsx @@ -0,0 +1,7 @@ +import type { FC } from "react" + +import type { ContextMenuProps } from "./index.ios" + +export const ContextMenu: FC = () => { + throw new Error("ContextMenu not implemented on Android") +} diff --git a/apps/mobile/src/components/ui/context-menu/index.ios.tsx b/apps/mobile/src/components/ui/context-menu/index.ios.tsx new file mode 100644 index 000000000..5a5237d1a --- /dev/null +++ b/apps/mobile/src/components/ui/context-menu/index.ios.tsx @@ -0,0 +1 @@ +export { default as ContextMenu, type ContextMenuProps } from "react-native-context-menu-view" diff --git a/apps/mobile/src/components/ui/context-menu/index.ts b/apps/mobile/src/components/ui/context-menu/index.ts new file mode 100644 index 000000000..df697997b --- /dev/null +++ b/apps/mobile/src/components/ui/context-menu/index.ts @@ -0,0 +1 @@ +export * from "./index.ios" diff --git a/apps/mobile/src/components/ui/icon/fallback-icon.tsx b/apps/mobile/src/components/ui/icon/fallback-icon.tsx new file mode 100644 index 000000000..198907151 --- /dev/null +++ b/apps/mobile/src/components/ui/icon/fallback-icon.tsx @@ -0,0 +1,52 @@ +import { getBackgroundGradient, isCJKChar } from "@follow/utils" +import { LinearGradient } from "expo-linear-gradient" +import { useMemo } from "react" +import type { StyleProp, ViewStyle } from "react-native" +import { StyleSheet, Text } from "react-native" + +export const FallbackIcon = ({ + title, + url, + size, + className, + style, +}: { + title: string + url?: string + size: number + className?: string + style?: StyleProp +}) => { + const colors = useMemo(() => getBackgroundGradient(title || url || ""), [title, url]) + const sizeStyle = useMemo(() => ({ width: size, height: size }), [size]) + + const [, , , bgAccent, bgAccentLight, bgAccentUltraLight] = colors + + const renderedText = useMemo(() => { + const isCJK = isCJKChar(title[0]) + return {isCJK ? title[0] : title.slice(0, 2)} + }, [title]) + + return ( + + {renderedText} + + ) +} + +const styles = StyleSheet.create({ + container: { + display: "flex", + alignItems: "center", + justifyContent: "center", + }, + text: { + fontSize: 12, + color: "#fff", + }, +}) diff --git a/apps/mobile/src/components/ui/icon/feed-icon.tsx b/apps/mobile/src/components/ui/icon/feed-icon.tsx new file mode 100644 index 000000000..48a4db177 --- /dev/null +++ b/apps/mobile/src/components/ui/icon/feed-icon.tsx @@ -0,0 +1,61 @@ +import type { FeedViewType } from "@follow/constants" +import { getUrlIcon } from "@follow/utils/src/utils" +import type { ReactNode } from "react" +import { useMemo } from "react" +import type { ImageProps } from "react-native" +import { Image } from "react-native" + +import type { FeedSchema } from "@/src/database/schemas/types" + +type FeedIconFeed = + | (Pick & { + type: FeedViewType + siteUrl?: string + }) + | FeedSchema + +const getFeedIconSrc = (siteUrl: string, fallback: boolean) => { + const ret = getUrlIcon(siteUrl, fallback) + + return [ret.src, ret.fallbackUrl] +} +interface FeedIconProps { + feed?: FeedIconFeed + fallbackUrl?: string + className?: string + size?: number + siteUrl?: string + /** + * Image loading error fallback to site icon + */ + fallback?: boolean + fallbackElement?: ReactNode +} +export function FeedIcon({ + feed, + fallbackUrl, + className, + size = 20, + fallback = true, + fallbackElement, + siteUrl, + ...props +}: FeedIconProps & ImageProps) { + const src = useMemo(() => { + switch (true) { + case !feed && !!siteUrl: { + const [src] = getFeedIconSrc(siteUrl, fallback) + return src + } + case !!feed && !!feed.image: { + return feed.image + } + case !!feed && !feed.image && !!feed.siteUrl: { + const [src] = getFeedIconSrc(feed.siteUrl, fallback) + return src + } + } + }, [fallback, feed, siteUrl]) + + return +} diff --git a/apps/mobile/src/components/ui/loading/index.tsx b/apps/mobile/src/components/ui/loading/index.tsx new file mode 100644 index 000000000..bd9f645e4 --- /dev/null +++ b/apps/mobile/src/components/ui/loading/index.tsx @@ -0,0 +1,49 @@ +import type { FC, PropsWithChildren } from "react" +import { useEffect } from "react" +import { View } from "react-native" +import Animated, { + Easing, + interpolate, + useAnimatedStyle, + useDerivedValue, + useSharedValue, + withRepeat, + withTiming, +} from "react-native-reanimated" + +import { Loading3CuteLiIcon } from "@/src/icons/loading_3_cute_li" + +export const LoadingIndicator: FC< + { + size?: number + } & PropsWithChildren +> = ({ size = 60, children }) => { + const rotateValue = useSharedValue(0) + + const rotation = useDerivedValue(() => { + return interpolate(rotateValue.value, [0, 360], [0, 360]) + }) + + const animatedStyle = useAnimatedStyle(() => ({ + transform: [{ rotate: `${rotation.value}deg` }], + })) + useEffect(() => { + rotateValue.value = withRepeat( + withTiming(360, { duration: 1000, easing: Easing.linear }), + -1, + false, + ) + + return () => { + rotateValue.value = 0 + } + }, [rotateValue]) + return ( + + + + + {children} + + ) +} diff --git a/apps/mobile/src/components/ui/logo/index.tsx b/apps/mobile/src/components/ui/logo/index.tsx new file mode 100644 index 000000000..a54b89f6c --- /dev/null +++ b/apps/mobile/src/components/ui/logo/index.tsx @@ -0,0 +1,51 @@ +import type { StyleProp, ViewStyle } from "react-native" +import type { SvgProps } from "react-native-svg" +import Svg, { ClipPath, Defs, G, Mask, Path, Rect } from "react-native-svg" + +import { accentColor } from "@/src/theme/colors" + +export const Logo: React.FC<{ color?: string } & SvgProps> = ({ color = accentColor, ...rest }) => { + return ( + + + + + + + + + + + + ) +} + +export const FollowIcon: React.FC<{ color: string; style?: StyleProp }> = ({ + color, + style, +}) => ( + + + + + + + + + + +) diff --git a/apps/mobile/src/components/ui/pressable/item-pressable.tsx b/apps/mobile/src/components/ui/pressable/item-pressable.tsx new file mode 100644 index 000000000..e614596ee --- /dev/null +++ b/apps/mobile/src/components/ui/pressable/item-pressable.tsx @@ -0,0 +1,22 @@ +import { cn, composeEventHandlers } from "@follow/utils" +import { memo, useState } from "react" +import { Pressable } from "react-native" + +export const ItemPressable: typeof Pressable = memo(({ children, ...props }) => { + const [isPressing, setIsPressing] = useState(false) + return ( + setIsPressing(true))} + onPressOut={composeEventHandlers(props.onPressOut, () => setIsPressing(false))} + onHoverIn={composeEventHandlers(props.onHoverIn, () => setIsPressing(true))} + onHoverOut={composeEventHandlers(props.onHoverOut, () => setIsPressing(false))} + className={cn( + isPressing ? "bg-tertiary-system-background" : "bg-system-background", + props.className, + )} + > + {children} + + ) +}) diff --git a/apps/mobile/src/constants/env.ts b/apps/mobile/src/constants/env.ts new file mode 100644 index 000000000..c96372730 --- /dev/null +++ b/apps/mobile/src/constants/env.ts @@ -0,0 +1,14 @@ +export const appEndpointMap = { + prod: { + api: "https://api.follow.is", + web: "https://app.follow.is", + }, + dev: { + api: "https://api.dev.follow.is", + web: "https://dev.follow.is", + }, + staging: { + api: "https://api.follow.is", + web: "https://staging.follow.is", + }, +} diff --git a/apps/mobile/src/constants/ui.ts b/apps/mobile/src/constants/ui.ts new file mode 100644 index 000000000..caa3ddddd --- /dev/null +++ b/apps/mobile/src/constants/ui.ts @@ -0,0 +1 @@ +export const bottomViewTabHeight = 35 diff --git a/apps/mobile/src/constants/views.tsx b/apps/mobile/src/constants/views.tsx new file mode 100644 index 000000000..18a61d48b --- /dev/null +++ b/apps/mobile/src/constants/views.tsx @@ -0,0 +1,65 @@ +import { FeedViewType } from "@follow/constants" +import type * as React from "react" +import colors from "tailwindcss/colors" + +import { AnnouncementCuteFiIcon } from "../icons/announcement_cute_fi" +import { MicCuteFiIcon } from "../icons/mic_cute_fi" +import { PaperCuteFiIcon } from "../icons/paper_cute_fi" +import { PicCuteFiIcon } from "../icons/pic_cute_fi" +import { TwitterCuteFiIcon } from "../icons/twitter_cute_fi" +import { VideoCuteFiIcon } from "../icons/video_cute_fi" +import { accentColor } from "../theme/colors" + +export interface ViewDefinition { + name: string + icon: React.FC<{ color?: string; height?: number; width?: number }> + activeColor: string + translation: string + view: FeedViewType + wideMode?: boolean + gridMode?: boolean +} +export const views: ViewDefinition[] = [ + { + name: "Articles", + icon: PaperCuteFiIcon, + activeColor: accentColor, + translation: "title,description", + view: FeedViewType.Articles, + }, + { + name: "Social Media", + icon: TwitterCuteFiIcon, + activeColor: colors.sky[500], + translation: "content", + view: FeedViewType.SocialMedia, + }, + { + name: "Pictures", + icon: PicCuteFiIcon, + activeColor: colors.green[500], + translation: "title", + view: FeedViewType.Pictures, + }, + { + name: "Videos", + icon: VideoCuteFiIcon, + activeColor: colors.red[500], + translation: "title", + view: FeedViewType.Videos, + }, + { + name: "Audios", + icon: MicCuteFiIcon, + activeColor: colors.purple[500], + translation: "title", + view: FeedViewType.Audios, + }, + { + name: "Notifications", + icon: AnnouncementCuteFiIcon, + activeColor: colors.yellow[500], + translation: "title", + view: FeedViewType.Notifications, + }, +] diff --git a/apps/mobile/src/database/index.ts b/apps/mobile/src/database/index.ts new file mode 100644 index 000000000..cef2d2206 --- /dev/null +++ b/apps/mobile/src/database/index.ts @@ -0,0 +1,25 @@ +import type { ExpoSQLiteDatabase } from "drizzle-orm/expo-sqlite" +import { drizzle } from "drizzle-orm/expo-sqlite" +import * as FileSystem from "expo-file-system" +import * as SQLite from "expo-sqlite" + +import * as schema from "./schemas" + +export const sqlite = SQLite.openDatabaseSync("follow.db") + +let db: ExpoSQLiteDatabase & { + $client: SQLite.SQLiteDatabase +} + +export function initializeDb() { + db = drizzle(sqlite, { + schema, + logger: true, + }) +} + +export { db } +export const getDbPath = () => { + return `${FileSystem.documentDirectory}SQLite/follow.db` +} +if (__DEV__) console.info("SQLite:", getDbPath()) diff --git a/apps/mobile/src/database/schemas/index.ts b/apps/mobile/src/database/schemas/index.ts new file mode 100644 index 000000000..600ec76c0 --- /dev/null +++ b/apps/mobile/src/database/schemas/index.ts @@ -0,0 +1,59 @@ +import type { FeedViewType } from "@follow/constants" +import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core" + +export const feedsTable = sqliteTable("feeds", { + id: text("id").primaryKey(), + title: text("title"), + url: text("url").notNull(), + description: text("description"), + image: text("image"), + errorAt: text("error_at"), + siteUrl: text("site_url"), + ownerUserId: text("owner_user_id"), + errorMessage: text("error_message"), +}) + +export const subscriptionsTable = sqliteTable("subscriptions", { + feedId: text("feed_id"), + listId: text("list_id"), + inboxId: text("inbox_id"), + userId: text("user_id").notNull(), + view: integer("view").notNull().$type(), + isPrivate: integer("is_private").notNull(), + title: text("title"), + category: text("category"), + createdAt: text("created_at"), + type: text("type").notNull().$type<"feed" | "list" | "inbox">(), + id: text("id").primaryKey(), +}) + +export const inboxesTable = sqliteTable("inboxes", { + id: text("id").primaryKey(), + title: text("title"), +}) + +export const listsTable = sqliteTable("lists", { + id: text("id").primaryKey(), + userId: text("user_id").notNull(), + title: text("title").notNull(), + feedIds: text("feed_ids", { mode: "json" }).$type(), + description: text("description"), + view: integer("view").notNull().$type(), + image: text("image"), + fee: integer("fee"), + ownerUserId: text("owner_user_id"), +}) + +export const unreadTable = sqliteTable("unread", { + subscriptionId: text("subscription_id").notNull().primaryKey(), + count: integer("count").notNull(), +}) + +export const usersTable = sqliteTable("users", { + id: text("id").primaryKey(), + email: text("email").notNull(), + handle: text("handle"), + name: text("name"), + image: text("image"), + isMe: integer("is_me").notNull(), +}) diff --git a/apps/mobile/src/database/schemas/types.ts b/apps/mobile/src/database/schemas/types.ts new file mode 100644 index 000000000..12fefcc6a --- /dev/null +++ b/apps/mobile/src/database/schemas/types.ts @@ -0,0 +1,20 @@ +import type { + feedsTable, + inboxesTable, + listsTable, + subscriptionsTable, + unreadTable, + usersTable, +} from "." + +export type SubscriptionSchema = typeof subscriptionsTable.$inferSelect + +export type FeedSchema = typeof feedsTable.$inferSelect + +export type InboxSchema = typeof inboxesTable.$inferSelect + +export type ListSchema = typeof listsTable.$inferSelect + +export type UnreadSchema = typeof unreadTable.$inferSelect + +export type UserSchema = typeof usersTable.$inferSelect diff --git a/apps/mobile/src/global.css b/apps/mobile/src/global.css new file mode 100644 index 000000000..b5c61c956 --- /dev/null +++ b/apps/mobile/src/global.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/apps/mobile/src/icons/AZ_sort_ascending_letters_cute_re.tsx b/apps/mobile/src/icons/AZ_sort_ascending_letters_cute_re.tsx new file mode 100644 index 000000000..d62d496b2 --- /dev/null +++ b/apps/mobile/src/icons/AZ_sort_ascending_letters_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface AZSortAscendingLettersCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const AZSortAscendingLettersCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: AZSortAscendingLettersCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/AZ_sort_descending_letters_cute_re.tsx b/apps/mobile/src/icons/AZ_sort_descending_letters_cute_re.tsx new file mode 100644 index 000000000..ce6824c76 --- /dev/null +++ b/apps/mobile/src/icons/AZ_sort_descending_letters_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface AZSortDescendingLettersCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const AZSortDescendingLettersCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: AZSortDescendingLettersCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/VIP_2_cute_fi.tsx b/apps/mobile/src/icons/VIP_2_cute_fi.tsx new file mode 100644 index 000000000..5c6da0d0f --- /dev/null +++ b/apps/mobile/src/icons/VIP_2_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface VIP2CuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const VIP2CuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: VIP2CuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/VIP_2_cute_re.tsx b/apps/mobile/src/icons/VIP_2_cute_re.tsx new file mode 100644 index 000000000..5e4ae6640 --- /dev/null +++ b/apps/mobile/src/icons/VIP_2_cute_re.tsx @@ -0,0 +1,31 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface VIP2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const VIP2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: VIP2CuteReIconProps) => { + return ( + + + + + + ) +} diff --git a/apps/mobile/src/icons/add_cute_re.tsx b/apps/mobile/src/icons/add_cute_re.tsx new file mode 100644 index 000000000..c2c63942c --- /dev/null +++ b/apps/mobile/src/icons/add_cute_re.tsx @@ -0,0 +1,21 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface AddCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const AddCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: AddCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/align_justify_cute_re.tsx b/apps/mobile/src/icons/align_justify_cute_re.tsx new file mode 100644 index 000000000..5ab9c094e --- /dev/null +++ b/apps/mobile/src/icons/align_justify_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface AlignJustifyCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const AlignJustifyCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: AlignJustifyCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/align_left_cute_re.tsx b/apps/mobile/src/icons/align_left_cute_re.tsx new file mode 100644 index 000000000..a5cc81627 --- /dev/null +++ b/apps/mobile/src/icons/align_left_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface AlignLeftCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const AlignLeftCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: AlignLeftCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/announcement_cute_fi.tsx b/apps/mobile/src/icons/announcement_cute_fi.tsx new file mode 100644 index 000000000..58ec8c66a --- /dev/null +++ b/apps/mobile/src/icons/announcement_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface AnnouncementCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const AnnouncementCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: AnnouncementCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/apple_cute_fi.tsx b/apps/mobile/src/icons/apple_cute_fi.tsx new file mode 100644 index 000000000..76dd1bf3c --- /dev/null +++ b/apps/mobile/src/icons/apple_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface AppleCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const AppleCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: AppleCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/arrow_right_circle_cute_fi.tsx b/apps/mobile/src/icons/arrow_right_circle_cute_fi.tsx new file mode 100644 index 000000000..232cebf42 --- /dev/null +++ b/apps/mobile/src/icons/arrow_right_circle_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface ArrowRightCircleCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const ArrowRightCircleCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: ArrowRightCircleCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/arrow_right_up_cute_re.tsx b/apps/mobile/src/icons/arrow_right_up_cute_re.tsx new file mode 100644 index 000000000..445b9036b --- /dev/null +++ b/apps/mobile/src/icons/arrow_right_up_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface ArrowRightUpCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const ArrowRightUpCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: ArrowRightUpCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/back_2_cute_re.tsx b/apps/mobile/src/icons/back_2_cute_re.tsx new file mode 100644 index 000000000..ff3f5d1a8 --- /dev/null +++ b/apps/mobile/src/icons/back_2_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Back2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Back2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Back2CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/bug_cute_re.tsx b/apps/mobile/src/icons/bug_cute_re.tsx new file mode 100644 index 000000000..dba4edd3c --- /dev/null +++ b/apps/mobile/src/icons/bug_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface BugCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const BugCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: BugCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/celebrate_cute_re.tsx b/apps/mobile/src/icons/celebrate_cute_re.tsx new file mode 100644 index 000000000..17bc899aa --- /dev/null +++ b/apps/mobile/src/icons/celebrate_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface CelebrateCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const CelebrateCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: CelebrateCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/certificate_cute_fi.tsx b/apps/mobile/src/icons/certificate_cute_fi.tsx new file mode 100644 index 000000000..15b843b58 --- /dev/null +++ b/apps/mobile/src/icons/certificate_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface CertificateCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const CertificateCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: CertificateCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/certificate_cute_re.tsx b/apps/mobile/src/icons/certificate_cute_re.tsx new file mode 100644 index 000000000..85e2f81b0 --- /dev/null +++ b/apps/mobile/src/icons/certificate_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface CertificateCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const CertificateCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: CertificateCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/check_circle_cute_re.tsx b/apps/mobile/src/icons/check_circle_cute_re.tsx new file mode 100644 index 000000000..937599780 --- /dev/null +++ b/apps/mobile/src/icons/check_circle_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface CheckCircleCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const CheckCircleCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: CheckCircleCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/check_circle_filled.tsx b/apps/mobile/src/icons/check_circle_filled.tsx new file mode 100644 index 000000000..24b373e91 --- /dev/null +++ b/apps/mobile/src/icons/check_circle_filled.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface CheckCircleFilledIconProps { + width?: number + height?: number + color?: string +} + +export const CheckCircleFilledIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: CheckCircleFilledIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/check_filled.tsx b/apps/mobile/src/icons/check_filled.tsx new file mode 100644 index 000000000..f6454863f --- /dev/null +++ b/apps/mobile/src/icons/check_filled.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface CheckFilledIconProps { + width?: number + height?: number + color?: string +} + +export const CheckFilledIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: CheckFilledIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/close_cute_re.tsx b/apps/mobile/src/icons/close_cute_re.tsx new file mode 100644 index 000000000..c5b193061 --- /dev/null +++ b/apps/mobile/src/icons/close_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface CloseCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const CloseCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: CloseCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/compass_3_cute_re.tsx b/apps/mobile/src/icons/compass_3_cute_re.tsx new file mode 100644 index 000000000..a622a82ba --- /dev/null +++ b/apps/mobile/src/icons/compass_3_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Compass3CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Compass3CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Compass3CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/compass_cute_fi.tsx b/apps/mobile/src/icons/compass_cute_fi.tsx new file mode 100644 index 000000000..ccafbb3e8 --- /dev/null +++ b/apps/mobile/src/icons/compass_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface CompassCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const CompassCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: CompassCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/copy_2_cute_re.tsx b/apps/mobile/src/icons/copy_2_cute_re.tsx new file mode 100644 index 000000000..cbea148f9 --- /dev/null +++ b/apps/mobile/src/icons/copy_2_cute_re.tsx @@ -0,0 +1,25 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Copy2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Copy2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Copy2CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/copy_cute_re.tsx b/apps/mobile/src/icons/copy_cute_re.tsx new file mode 100644 index 000000000..52c03ad1c --- /dev/null +++ b/apps/mobile/src/icons/copy_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface CopyCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const CopyCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: CopyCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/cursor_3_cute_re.tsx b/apps/mobile/src/icons/cursor_3_cute_re.tsx new file mode 100644 index 000000000..7c35eb8dd --- /dev/null +++ b/apps/mobile/src/icons/cursor_3_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Cursor3CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Cursor3CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Cursor3CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/delete_2_cute_re.tsx b/apps/mobile/src/icons/delete_2_cute_re.tsx new file mode 100644 index 000000000..371d78add --- /dev/null +++ b/apps/mobile/src/icons/delete_2_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Delete2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Delete2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Delete2CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/department_cute_re.tsx b/apps/mobile/src/icons/department_cute_re.tsx new file mode 100644 index 000000000..c94561bb5 --- /dev/null +++ b/apps/mobile/src/icons/department_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface DepartmentCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const DepartmentCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: DepartmentCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/discord_cute_fi.tsx b/apps/mobile/src/icons/discord_cute_fi.tsx new file mode 100644 index 000000000..68f886c09 --- /dev/null +++ b/apps/mobile/src/icons/discord_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface DiscordCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const DiscordCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: DiscordCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/docment_cute_fi.tsx b/apps/mobile/src/icons/docment_cute_fi.tsx new file mode 100644 index 000000000..d2d3cfc6c --- /dev/null +++ b/apps/mobile/src/icons/docment_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface DocmentCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const DocmentCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: DocmentCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/docment_cute_re.tsx b/apps/mobile/src/icons/docment_cute_re.tsx new file mode 100644 index 000000000..76241465d --- /dev/null +++ b/apps/mobile/src/icons/docment_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface DocmentCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const DocmentCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: DocmentCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/download_2_cute_fi.tsx b/apps/mobile/src/icons/download_2_cute_fi.tsx new file mode 100644 index 000000000..cbda2dc43 --- /dev/null +++ b/apps/mobile/src/icons/download_2_cute_fi.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Download2CuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const Download2CuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Download2CuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/download_2_cute_re.tsx b/apps/mobile/src/icons/download_2_cute_re.tsx new file mode 100644 index 000000000..1c114ac4b --- /dev/null +++ b/apps/mobile/src/icons/download_2_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Download2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Download2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Download2CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/edit_cute_re.tsx b/apps/mobile/src/icons/edit_cute_re.tsx new file mode 100644 index 000000000..3358f4578 --- /dev/null +++ b/apps/mobile/src/icons/edit_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface EditCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const EditCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: EditCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/exit_cute_re.tsx b/apps/mobile/src/icons/exit_cute_re.tsx new file mode 100644 index 000000000..5b0e5a0db --- /dev/null +++ b/apps/mobile/src/icons/exit_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface ExitCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const ExitCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: ExitCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/external_link_cute_re.tsx b/apps/mobile/src/icons/external_link_cute_re.tsx new file mode 100644 index 000000000..53fe1232b --- /dev/null +++ b/apps/mobile/src/icons/external_link_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface ExternalLinkCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const ExternalLinkCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: ExternalLinkCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/eye_2_cute_re.tsx b/apps/mobile/src/icons/eye_2_cute_re.tsx new file mode 100644 index 000000000..54cf2becf --- /dev/null +++ b/apps/mobile/src/icons/eye_2_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Eye2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Eye2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Eye2CuteReIconProps) => { + return ( + + + + + + ) +} diff --git a/apps/mobile/src/icons/eye_close_cute_re.tsx b/apps/mobile/src/icons/eye_close_cute_re.tsx new file mode 100644 index 000000000..039e9e591 --- /dev/null +++ b/apps/mobile/src/icons/eye_close_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface EyeCloseCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const EyeCloseCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: EyeCloseCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/fast_forward_cute_re.tsx b/apps/mobile/src/icons/fast_forward_cute_re.tsx new file mode 100644 index 000000000..f593aad98 --- /dev/null +++ b/apps/mobile/src/icons/fast_forward_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface FastForwardCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const FastForwardCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: FastForwardCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/file_import_cute_re.tsx b/apps/mobile/src/icons/file_import_cute_re.tsx new file mode 100644 index 000000000..ebb39bb88 --- /dev/null +++ b/apps/mobile/src/icons/file_import_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface FileImportCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const FileImportCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: FileImportCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/file_upload_cute_re.tsx b/apps/mobile/src/icons/file_upload_cute_re.tsx new file mode 100644 index 000000000..76fb9b9c0 --- /dev/null +++ b/apps/mobile/src/icons/file_upload_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface FileUploadCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const FileUploadCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: FileUploadCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/fire_cute_fi.tsx b/apps/mobile/src/icons/fire_cute_fi.tsx new file mode 100644 index 000000000..aaea19238 --- /dev/null +++ b/apps/mobile/src/icons/fire_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface FireCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const FireCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: FireCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/flag_1_cute_fi.tsx b/apps/mobile/src/icons/flag_1_cute_fi.tsx new file mode 100644 index 000000000..01d1be307 --- /dev/null +++ b/apps/mobile/src/icons/flag_1_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Flag1CuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const Flag1CuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Flag1CuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/folder_open_cute_re.tsx b/apps/mobile/src/icons/folder_open_cute_re.tsx new file mode 100644 index 000000000..c3ed3e5a4 --- /dev/null +++ b/apps/mobile/src/icons/folder_open_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface FolderOpenCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const FolderOpenCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: FolderOpenCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/forward_2_cute_re.tsx b/apps/mobile/src/icons/forward_2_cute_re.tsx new file mode 100644 index 000000000..9fe632e1e --- /dev/null +++ b/apps/mobile/src/icons/forward_2_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Forward2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Forward2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Forward2CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/fullscreen_2_cute_re.tsx b/apps/mobile/src/icons/fullscreen_2_cute_re.tsx new file mode 100644 index 000000000..82202e403 --- /dev/null +++ b/apps/mobile/src/icons/fullscreen_2_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Fullscreen2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Fullscreen2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Fullscreen2CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/fullscreen_cute_re.tsx b/apps/mobile/src/icons/fullscreen_cute_re.tsx new file mode 100644 index 000000000..2a1423383 --- /dev/null +++ b/apps/mobile/src/icons/fullscreen_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface FullscreenCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const FullscreenCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: FullscreenCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/fullscreen_exit_cute_re.tsx b/apps/mobile/src/icons/fullscreen_exit_cute_re.tsx new file mode 100644 index 000000000..bafe47580 --- /dev/null +++ b/apps/mobile/src/icons/fullscreen_exit_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface FullscreenExitCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const FullscreenExitCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: FullscreenExitCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/gift_cute_re.tsx b/apps/mobile/src/icons/gift_cute_re.tsx new file mode 100644 index 000000000..aae89e1dc --- /dev/null +++ b/apps/mobile/src/icons/gift_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface GiftCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const GiftCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: GiftCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/github_2_cute_fi.tsx b/apps/mobile/src/icons/github_2_cute_fi.tsx new file mode 100644 index 000000000..0082e8063 --- /dev/null +++ b/apps/mobile/src/icons/github_2_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Github2CuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const Github2CuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Github2CuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/github_cute_fi.tsx b/apps/mobile/src/icons/github_cute_fi.tsx new file mode 100644 index 000000000..194a93f9f --- /dev/null +++ b/apps/mobile/src/icons/github_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface GithubCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const GithubCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: GithubCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/google_cute_fi.tsx b/apps/mobile/src/icons/google_cute_fi.tsx new file mode 100644 index 000000000..0a1320a27 --- /dev/null +++ b/apps/mobile/src/icons/google_cute_fi.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface GoogleCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const GoogleCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: GoogleCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/grid_2_cute_re.tsx b/apps/mobile/src/icons/grid_2_cute_re.tsx new file mode 100644 index 000000000..f9d1263c8 --- /dev/null +++ b/apps/mobile/src/icons/grid_2_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Grid2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Grid2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Grid2CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/grid_cute_re.tsx b/apps/mobile/src/icons/grid_cute_re.tsx new file mode 100644 index 000000000..71464419a --- /dev/null +++ b/apps/mobile/src/icons/grid_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface GridCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const GridCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: GridCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/heart_cute_fi.tsx b/apps/mobile/src/icons/heart_cute_fi.tsx new file mode 100644 index 000000000..fb670e544 --- /dev/null +++ b/apps/mobile/src/icons/heart_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface HeartCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const HeartCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: HeartCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/hotkey_cute_re.tsx b/apps/mobile/src/icons/hotkey_cute_re.tsx new file mode 100644 index 000000000..3b21f5d6d --- /dev/null +++ b/apps/mobile/src/icons/hotkey_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface HotkeyCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const HotkeyCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: HotkeyCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/inbox_cute_fi.tsx b/apps/mobile/src/icons/inbox_cute_fi.tsx new file mode 100644 index 000000000..1a957e847 --- /dev/null +++ b/apps/mobile/src/icons/inbox_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface InboxCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const InboxCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: InboxCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/inbox_cute_re.tsx b/apps/mobile/src/icons/inbox_cute_re.tsx new file mode 100644 index 000000000..a916cf856 --- /dev/null +++ b/apps/mobile/src/icons/inbox_cute_re.tsx @@ -0,0 +1,25 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface InboxCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const InboxCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: InboxCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/information_cute_re copy.tsx b/apps/mobile/src/icons/information_cute_re copy.tsx new file mode 100644 index 000000000..ab3ae38cb --- /dev/null +++ b/apps/mobile/src/icons/information_cute_re copy.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface InformationCuteReCopyIconProps { + width?: number + height?: number + color?: string +} + +export const InformationCuteReCopyIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: InformationCuteReCopyIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/information_cute_re.tsx b/apps/mobile/src/icons/information_cute_re.tsx new file mode 100644 index 000000000..17399a943 --- /dev/null +++ b/apps/mobile/src/icons/information_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface InformationCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const InformationCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: InformationCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/layout_4_cute_re.tsx b/apps/mobile/src/icons/layout_4_cute_re.tsx new file mode 100644 index 000000000..89128e520 --- /dev/null +++ b/apps/mobile/src/icons/layout_4_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Layout4CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Layout4CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Layout4CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/layout_leftbar_close_cute_re.tsx b/apps/mobile/src/icons/layout_leftbar_close_cute_re.tsx new file mode 100644 index 000000000..84d00482e --- /dev/null +++ b/apps/mobile/src/icons/layout_leftbar_close_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface LayoutLeftbarCloseCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const LayoutLeftbarCloseCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: LayoutLeftbarCloseCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/layout_leftbar_open_cute_re.tsx b/apps/mobile/src/icons/layout_leftbar_open_cute_re.tsx new file mode 100644 index 000000000..922a99fc4 --- /dev/null +++ b/apps/mobile/src/icons/layout_leftbar_open_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface LayoutLeftbarOpenCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const LayoutLeftbarOpenCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: LayoutLeftbarOpenCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/left_cute_fi.tsx b/apps/mobile/src/icons/left_cute_fi.tsx new file mode 100644 index 000000000..d1b225d72 --- /dev/null +++ b/apps/mobile/src/icons/left_cute_fi.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface LeftCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const LeftCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: LeftCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/line_cute_re.tsx b/apps/mobile/src/icons/line_cute_re.tsx new file mode 100644 index 000000000..1c348baf7 --- /dev/null +++ b/apps/mobile/src/icons/line_cute_re.tsx @@ -0,0 +1,21 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface LineCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const LineCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: LineCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/link_cute_re.tsx b/apps/mobile/src/icons/link_cute_re.tsx new file mode 100644 index 000000000..4961462d4 --- /dev/null +++ b/apps/mobile/src/icons/link_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface LinkCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const LinkCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: LinkCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/list_check_3_cute_re.tsx b/apps/mobile/src/icons/list_check_3_cute_re.tsx new file mode 100644 index 000000000..679391310 --- /dev/null +++ b/apps/mobile/src/icons/list_check_3_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface ListCheck3CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const ListCheck3CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: ListCheck3CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/list_check_cute_re.tsx b/apps/mobile/src/icons/list_check_cute_re.tsx new file mode 100644 index 000000000..0894fad58 --- /dev/null +++ b/apps/mobile/src/icons/list_check_cute_re.tsx @@ -0,0 +1,30 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface ListCheckCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const ListCheckCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: ListCheckCuteReIconProps) => { + return ( + + + + + + ) +} diff --git a/apps/mobile/src/icons/list_collapse_cute_fi.tsx b/apps/mobile/src/icons/list_collapse_cute_fi.tsx new file mode 100644 index 000000000..cf247b5aa --- /dev/null +++ b/apps/mobile/src/icons/list_collapse_cute_fi.tsx @@ -0,0 +1,30 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface ListCollapseCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const ListCollapseCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: ListCollapseCuteFiIconProps) => { + return ( + + + + + + ) +} diff --git a/apps/mobile/src/icons/list_collapse_cute_re.tsx b/apps/mobile/src/icons/list_collapse_cute_re.tsx new file mode 100644 index 000000000..31e72e790 --- /dev/null +++ b/apps/mobile/src/icons/list_collapse_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface ListCollapseCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const ListCollapseCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: ListCollapseCuteReIconProps) => { + return ( + + + + + + ) +} diff --git a/apps/mobile/src/icons/list_expansion_cute_fi.tsx b/apps/mobile/src/icons/list_expansion_cute_fi.tsx new file mode 100644 index 000000000..f6437d28b --- /dev/null +++ b/apps/mobile/src/icons/list_expansion_cute_fi.tsx @@ -0,0 +1,30 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface ListExpansionCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const ListExpansionCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: ListExpansionCuteFiIconProps) => { + return ( + + + + + + ) +} diff --git a/apps/mobile/src/icons/list_expansion_cute_re.tsx b/apps/mobile/src/icons/list_expansion_cute_re.tsx new file mode 100644 index 000000000..5740af66d --- /dev/null +++ b/apps/mobile/src/icons/list_expansion_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface ListExpansionCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const ListExpansionCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: ListExpansionCuteReIconProps) => { + return ( + + + + + + ) +} diff --git a/apps/mobile/src/icons/loading_3_cute_li.tsx b/apps/mobile/src/icons/loading_3_cute_li.tsx new file mode 100644 index 000000000..77790b044 --- /dev/null +++ b/apps/mobile/src/icons/loading_3_cute_li.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Loading3CuteLiIconProps { + width?: number + height?: number + color?: string +} + +export const Loading3CuteLiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Loading3CuteLiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/loading_3_cute_re.tsx b/apps/mobile/src/icons/loading_3_cute_re.tsx new file mode 100644 index 000000000..9ddd9d61c --- /dev/null +++ b/apps/mobile/src/icons/loading_3_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Loading3CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Loading3CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Loading3CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/love_cute_re.tsx b/apps/mobile/src/icons/love_cute_re.tsx new file mode 100644 index 000000000..00289e1c8 --- /dev/null +++ b/apps/mobile/src/icons/love_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface LoveCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const LoveCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: LoveCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/magic_2_cute_re.tsx b/apps/mobile/src/icons/magic_2_cute_re.tsx new file mode 100644 index 000000000..28b69b806 --- /dev/null +++ b/apps/mobile/src/icons/magic_2_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Magic2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Magic2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Magic2CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/mic_cute_fi.tsx b/apps/mobile/src/icons/mic_cute_fi.tsx new file mode 100644 index 000000000..3fd93f77e --- /dev/null +++ b/apps/mobile/src/icons/mic_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface MicCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const MicCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: MicCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/mingcute_right_line.tsx b/apps/mobile/src/icons/mingcute_right_line.tsx new file mode 100644 index 000000000..951c5e78b --- /dev/null +++ b/apps/mobile/src/icons/mingcute_right_line.tsx @@ -0,0 +1,23 @@ +import Svg, { G, Path } from "react-native-svg" + +export function MingcuteRightLine({ + color, + height, + width, +}: { + width?: number + height?: number + color?: string +}) { + return ( + + + + + + + ) +} diff --git a/apps/mobile/src/icons/more_1_cute_re.tsx b/apps/mobile/src/icons/more_1_cute_re.tsx new file mode 100644 index 000000000..63725ccbf --- /dev/null +++ b/apps/mobile/src/icons/more_1_cute_re.tsx @@ -0,0 +1,29 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface More1CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const More1CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: More1CuteReIconProps) => { + return ( + + + + + + ) +} diff --git a/apps/mobile/src/icons/numbers_09_sort_ascending_cute_re.tsx b/apps/mobile/src/icons/numbers_09_sort_ascending_cute_re.tsx new file mode 100644 index 000000000..9cd3166cf --- /dev/null +++ b/apps/mobile/src/icons/numbers_09_sort_ascending_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Numbers09SortAscendingCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Numbers09SortAscendingCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Numbers09SortAscendingCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/numbers_09_sort_descending_cute_re.tsx b/apps/mobile/src/icons/numbers_09_sort_descending_cute_re.tsx new file mode 100644 index 000000000..85c8cf391 --- /dev/null +++ b/apps/mobile/src/icons/numbers_09_sort_descending_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Numbers09SortDescendingCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Numbers09SortDescendingCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Numbers09SortDescendingCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/numbers_90_sort_ascending_cute_re.tsx b/apps/mobile/src/icons/numbers_90_sort_ascending_cute_re.tsx new file mode 100644 index 000000000..77bc34767 --- /dev/null +++ b/apps/mobile/src/icons/numbers_90_sort_ascending_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Numbers90SortAscendingCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Numbers90SortAscendingCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Numbers90SortAscendingCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/numbers_90_sort_descending_cute_re.tsx b/apps/mobile/src/icons/numbers_90_sort_descending_cute_re.tsx new file mode 100644 index 000000000..3f60e3bb6 --- /dev/null +++ b/apps/mobile/src/icons/numbers_90_sort_descending_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Numbers90SortDescendingCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Numbers90SortDescendingCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Numbers90SortDescendingCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/palette_cute_re.tsx b/apps/mobile/src/icons/palette_cute_re.tsx new file mode 100644 index 000000000..9f07abc8e --- /dev/null +++ b/apps/mobile/src/icons/palette_cute_re.tsx @@ -0,0 +1,34 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface PaletteCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const PaletteCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: PaletteCuteReIconProps) => { + return ( + + + + + + + ) +} diff --git a/apps/mobile/src/icons/paper_cute_fi.tsx b/apps/mobile/src/icons/paper_cute_fi.tsx new file mode 100644 index 000000000..628aec763 --- /dev/null +++ b/apps/mobile/src/icons/paper_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface PaperCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const PaperCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: PaperCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/pause_cute_fi.tsx b/apps/mobile/src/icons/pause_cute_fi.tsx new file mode 100644 index 000000000..b18777503 --- /dev/null +++ b/apps/mobile/src/icons/pause_cute_fi.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface PauseCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const PauseCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: PauseCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/pause_cute_re.tsx b/apps/mobile/src/icons/pause_cute_re.tsx new file mode 100644 index 000000000..27619cfa7 --- /dev/null +++ b/apps/mobile/src/icons/pause_cute_re.tsx @@ -0,0 +1,21 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface PauseCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const PauseCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: PauseCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/photo_album_cute_fi.tsx b/apps/mobile/src/icons/photo_album_cute_fi.tsx new file mode 100644 index 000000000..24b01b77f --- /dev/null +++ b/apps/mobile/src/icons/photo_album_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface PhotoAlbumCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const PhotoAlbumCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: PhotoAlbumCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/photo_album_cute_re.tsx b/apps/mobile/src/icons/photo_album_cute_re.tsx new file mode 100644 index 000000000..8228d895c --- /dev/null +++ b/apps/mobile/src/icons/photo_album_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface PhotoAlbumCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const PhotoAlbumCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: PhotoAlbumCuteReIconProps) => { + return ( + + + + + + ) +} diff --git a/apps/mobile/src/icons/pic_cute_fi.tsx b/apps/mobile/src/icons/pic_cute_fi.tsx new file mode 100644 index 000000000..fa30b9fa0 --- /dev/null +++ b/apps/mobile/src/icons/pic_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface PicCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const PicCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: PicCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/play_cute_fi.tsx b/apps/mobile/src/icons/play_cute_fi.tsx new file mode 100644 index 000000000..9e8645e33 --- /dev/null +++ b/apps/mobile/src/icons/play_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface PlayCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const PlayCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: PlayCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/play_cute_re.tsx b/apps/mobile/src/icons/play_cute_re.tsx new file mode 100644 index 000000000..a4bbc604f --- /dev/null +++ b/apps/mobile/src/icons/play_cute_re.tsx @@ -0,0 +1,25 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface PlayCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const PlayCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: PlayCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/power.tsx b/apps/mobile/src/icons/power.tsx new file mode 100644 index 000000000..5268567df --- /dev/null +++ b/apps/mobile/src/icons/power.tsx @@ -0,0 +1,21 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface PowerIconProps { + width?: number + height?: number + color?: string +} + +export const PowerIcon = ({ width = 24, height = 24, color = "#10161F" }: PowerIconProps) => { + return ( + + + + ) +} diff --git a/apps/mobile/src/icons/power_mono.tsx b/apps/mobile/src/icons/power_mono.tsx new file mode 100644 index 000000000..1946376cc --- /dev/null +++ b/apps/mobile/src/icons/power_mono.tsx @@ -0,0 +1,25 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface PowerMonoIconProps { + width?: number + height?: number + color?: string +} + +export const PowerMonoIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: PowerMonoIconProps) => { + return ( + + + + ) +} diff --git a/apps/mobile/src/icons/power_outline.tsx b/apps/mobile/src/icons/power_outline.tsx new file mode 100644 index 000000000..764420847 --- /dev/null +++ b/apps/mobile/src/icons/power_outline.tsx @@ -0,0 +1,28 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface PowerOutlineIconProps { + width?: number + height?: number + color?: string +} + +export const PowerOutlineIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: PowerOutlineIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/question_cute_re.tsx b/apps/mobile/src/icons/question_cute_re.tsx new file mode 100644 index 000000000..b03eb7af7 --- /dev/null +++ b/apps/mobile/src/icons/question_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface QuestionCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const QuestionCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: QuestionCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/rada_cute_fi.tsx b/apps/mobile/src/icons/rada_cute_fi.tsx new file mode 100644 index 000000000..c124d6eaf --- /dev/null +++ b/apps/mobile/src/icons/rada_cute_fi.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface RadaCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const RadaCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: RadaCuteFiIconProps) => { + return ( + + + + + + ) +} diff --git a/apps/mobile/src/icons/rada_cute_re.tsx b/apps/mobile/src/icons/rada_cute_re.tsx new file mode 100644 index 000000000..2b93c9b5f --- /dev/null +++ b/apps/mobile/src/icons/rada_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface RadaCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const RadaCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: RadaCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/refresh_2_cute_re.tsx b/apps/mobile/src/icons/refresh_2_cute_re.tsx new file mode 100644 index 000000000..a5a359cf1 --- /dev/null +++ b/apps/mobile/src/icons/refresh_2_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Refresh2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Refresh2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Refresh2CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/right_cute_fi.tsx b/apps/mobile/src/icons/right_cute_fi.tsx new file mode 100644 index 000000000..bd7eb2f6a --- /dev/null +++ b/apps/mobile/src/icons/right_cute_fi.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface RightCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const RightCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: RightCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/right_cute_li.tsx b/apps/mobile/src/icons/right_cute_li.tsx new file mode 100644 index 000000000..10f290fda --- /dev/null +++ b/apps/mobile/src/icons/right_cute_li.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface RightCuteLiIconProps { + width?: number + height?: number + color?: string +} + +export const RightCuteLiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: RightCuteLiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/right_cute_re.tsx b/apps/mobile/src/icons/right_cute_re.tsx new file mode 100644 index 000000000..1837a488b --- /dev/null +++ b/apps/mobile/src/icons/right_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface RightCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const RightCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: RightCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/rocket_cute_fi.tsx b/apps/mobile/src/icons/rocket_cute_fi.tsx new file mode 100644 index 000000000..52cc9af94 --- /dev/null +++ b/apps/mobile/src/icons/rocket_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface RocketCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const RocketCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: RocketCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/rocket_cute_re.tsx b/apps/mobile/src/icons/rocket_cute_re.tsx new file mode 100644 index 000000000..6df85b07b --- /dev/null +++ b/apps/mobile/src/icons/rocket_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface RocketCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const RocketCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: RocketCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/rss_2_cute_fi.tsx b/apps/mobile/src/icons/rss_2_cute_fi.tsx new file mode 100644 index 000000000..cba3964b5 --- /dev/null +++ b/apps/mobile/src/icons/rss_2_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Rss2CuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const Rss2CuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Rss2CuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/rss_cute_fi.tsx b/apps/mobile/src/icons/rss_cute_fi.tsx new file mode 100644 index 000000000..1f4c84ae3 --- /dev/null +++ b/apps/mobile/src/icons/rss_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface RssCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const RssCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: RssCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/sad_cute_re.tsx b/apps/mobile/src/icons/sad_cute_re.tsx new file mode 100644 index 000000000..16d383e41 --- /dev/null +++ b/apps/mobile/src/icons/sad_cute_re.tsx @@ -0,0 +1,30 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface SadCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const SadCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: SadCuteReIconProps) => { + return ( + + + + + + ) +} diff --git a/apps/mobile/src/icons/safari_cute-re.tsx b/apps/mobile/src/icons/safari_cute-re.tsx new file mode 100644 index 000000000..c1818203d --- /dev/null +++ b/apps/mobile/src/icons/safari_cute-re.tsx @@ -0,0 +1,23 @@ +import * as React from "react" +import type { SvgProps } from "react-native-svg" +import Svg, { Path } from "react-native-svg" + +export const SafariCuteIcon = ( + props: SvgProps & { + color?: string + }, +) => ( + + + + + +) diff --git a/apps/mobile/src/icons/safari_cute_fi.tsx b/apps/mobile/src/icons/safari_cute_fi.tsx new file mode 100644 index 000000000..077cd42e6 --- /dev/null +++ b/apps/mobile/src/icons/safari_cute_fi.tsx @@ -0,0 +1,15 @@ +import * as React from "react" +import type { SvgProps } from "react-native-svg" +import Svg, { Path } from "react-native-svg" + +export const SafariCuteFi = (props: SvgProps) => ( + + + + +) diff --git a/apps/mobile/src/icons/search_2_cute_re.tsx b/apps/mobile/src/icons/search_2_cute_re.tsx new file mode 100644 index 000000000..fa803559d --- /dev/null +++ b/apps/mobile/src/icons/search_2_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Search2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Search2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Search2CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/setting_7_cute_fi.tsx b/apps/mobile/src/icons/setting_7_cute_fi.tsx new file mode 100644 index 000000000..dde4d9ada --- /dev/null +++ b/apps/mobile/src/icons/setting_7_cute_fi.tsx @@ -0,0 +1,15 @@ +import * as React from "react" +import type { SvgProps } from "react-native-svg" +import Svg, { Path } from "react-native-svg" + +export const Setting7CuteFi = (props: SvgProps) => ( + + + + +) diff --git a/apps/mobile/src/icons/settings_7_cute_re.tsx b/apps/mobile/src/icons/settings_7_cute_re.tsx new file mode 100644 index 000000000..6ebc36044 --- /dev/null +++ b/apps/mobile/src/icons/settings_7_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Settings7CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Settings7CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Settings7CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/share_3_cute_re.tsx b/apps/mobile/src/icons/share_3_cute_re.tsx new file mode 100644 index 000000000..a37b1aaa6 --- /dev/null +++ b/apps/mobile/src/icons/share_3_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Share3CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Share3CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Share3CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/share_forward_cute_re.tsx b/apps/mobile/src/icons/share_forward_cute_re.tsx new file mode 100644 index 000000000..8d4f1589c --- /dev/null +++ b/apps/mobile/src/icons/share_forward_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface ShareForwardCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const ShareForwardCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: ShareForwardCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/social_x_cute_li.tsx b/apps/mobile/src/icons/social_x_cute_li.tsx new file mode 100644 index 000000000..79e561a1f --- /dev/null +++ b/apps/mobile/src/icons/social_x_cute_li.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface SocialXCuteLiIconProps { + width?: number + height?: number + color?: string +} + +export const SocialXCuteLiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: SocialXCuteLiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/social_x_cute_re.tsx b/apps/mobile/src/icons/social_x_cute_re.tsx new file mode 100644 index 000000000..1ba7e58a7 --- /dev/null +++ b/apps/mobile/src/icons/social_x_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface SocialXCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const SocialXCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: SocialXCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/sort_ascending_cute_re.tsx b/apps/mobile/src/icons/sort_ascending_cute_re.tsx new file mode 100644 index 000000000..e7d0ec920 --- /dev/null +++ b/apps/mobile/src/icons/sort_ascending_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface SortAscendingCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const SortAscendingCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: SortAscendingCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/sort_descending_cute_re.tsx b/apps/mobile/src/icons/sort_descending_cute_re.tsx new file mode 100644 index 000000000..37f69f63a --- /dev/null +++ b/apps/mobile/src/icons/sort_descending_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface SortDescendingCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const SortDescendingCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: SortDescendingCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/star_cute_fi.tsx b/apps/mobile/src/icons/star_cute_fi.tsx new file mode 100644 index 000000000..429ce01fd --- /dev/null +++ b/apps/mobile/src/icons/star_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface StarCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const StarCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: StarCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/star_cute_re.tsx b/apps/mobile/src/icons/star_cute_re.tsx new file mode 100644 index 000000000..d9ab4287b --- /dev/null +++ b/apps/mobile/src/icons/star_cute_re.tsx @@ -0,0 +1,25 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface StarCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const StarCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: StarCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/time_cute_re copy.tsx b/apps/mobile/src/icons/time_cute_re copy.tsx new file mode 100644 index 000000000..597dbf373 --- /dev/null +++ b/apps/mobile/src/icons/time_cute_re copy.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface TimeCuteReCopyIconProps { + width?: number + height?: number + color?: string +} + +export const TimeCuteReCopyIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: TimeCuteReCopyIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/time_cute_re.tsx b/apps/mobile/src/icons/time_cute_re.tsx new file mode 100644 index 000000000..8f98fee80 --- /dev/null +++ b/apps/mobile/src/icons/time_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface TimeCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const TimeCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: TimeCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/train_cute_fi.tsx b/apps/mobile/src/icons/train_cute_fi.tsx new file mode 100644 index 000000000..baa3085a5 --- /dev/null +++ b/apps/mobile/src/icons/train_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface TrainCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const TrainCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: TrainCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/translate_2_cute_re.tsx b/apps/mobile/src/icons/translate_2_cute_re.tsx new file mode 100644 index 000000000..c6743534c --- /dev/null +++ b/apps/mobile/src/icons/translate_2_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface Translate2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const Translate2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: Translate2CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/trending_up_cute_re.tsx b/apps/mobile/src/icons/trending_up_cute_re.tsx new file mode 100644 index 000000000..e1c934cbd --- /dev/null +++ b/apps/mobile/src/icons/trending_up_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface TrendingUpCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const TrendingUpCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: TrendingUpCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/trophy_cute_re.tsx b/apps/mobile/src/icons/trophy_cute_re.tsx new file mode 100644 index 000000000..8d2d6ebd8 --- /dev/null +++ b/apps/mobile/src/icons/trophy_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface TrophyCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const TrophyCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: TrophyCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/twitter_cute_fi.tsx b/apps/mobile/src/icons/twitter_cute_fi.tsx new file mode 100644 index 000000000..b3d8d4398 --- /dev/null +++ b/apps/mobile/src/icons/twitter_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface TwitterCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const TwitterCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: TwitterCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/user_3_cute_re.tsx b/apps/mobile/src/icons/user_3_cute_re.tsx new file mode 100644 index 000000000..94b82e7b6 --- /dev/null +++ b/apps/mobile/src/icons/user_3_cute_re.tsx @@ -0,0 +1,25 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface User3CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const User3CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: User3CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/user_heart_cute_fi.tsx b/apps/mobile/src/icons/user_heart_cute_fi.tsx new file mode 100644 index 000000000..63535109a --- /dev/null +++ b/apps/mobile/src/icons/user_heart_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface UserHeartCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const UserHeartCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: UserHeartCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/user_heart_cute_re.tsx b/apps/mobile/src/icons/user_heart_cute_re.tsx new file mode 100644 index 000000000..16896de40 --- /dev/null +++ b/apps/mobile/src/icons/user_heart_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface UserHeartCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const UserHeartCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: UserHeartCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/user_setting_cute_re.tsx b/apps/mobile/src/icons/user_setting_cute_re.tsx new file mode 100644 index 000000000..7cafdcf79 --- /dev/null +++ b/apps/mobile/src/icons/user_setting_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface UserSettingCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const UserSettingCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: UserSettingCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/video_cute_fi.tsx b/apps/mobile/src/icons/video_cute_fi.tsx new file mode 100644 index 000000000..2621c02a9 --- /dev/null +++ b/apps/mobile/src/icons/video_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface VideoCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const VideoCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: VideoCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/voice_cute_re.tsx b/apps/mobile/src/icons/voice_cute_re.tsx new file mode 100644 index 000000000..d8c4bb151 --- /dev/null +++ b/apps/mobile/src/icons/voice_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface VoiceCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const VoiceCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: VoiceCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/volume_cute_re.tsx b/apps/mobile/src/icons/volume_cute_re.tsx new file mode 100644 index 000000000..c19d66f1b --- /dev/null +++ b/apps/mobile/src/icons/volume_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface VolumeCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const VolumeCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: VolumeCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/volume_mute_cute_re.tsx b/apps/mobile/src/icons/volume_mute_cute_re.tsx new file mode 100644 index 000000000..fec07290e --- /dev/null +++ b/apps/mobile/src/icons/volume_mute_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface VolumeMuteCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const VolumeMuteCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: VolumeMuteCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/volume_off_cute_re.tsx b/apps/mobile/src/icons/volume_off_cute_re.tsx new file mode 100644 index 000000000..6819f8ea6 --- /dev/null +++ b/apps/mobile/src/icons/volume_off_cute_re.tsx @@ -0,0 +1,27 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface VolumeOffCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const VolumeOffCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: VolumeOffCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/wifi_off_cute_re.tsx b/apps/mobile/src/icons/wifi_off_cute_re.tsx new file mode 100644 index 000000000..7df7442db --- /dev/null +++ b/apps/mobile/src/icons/wifi_off_cute_re.tsx @@ -0,0 +1,24 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface WifiOffCuteReIconProps { + width?: number + height?: number + color?: string +} + +export const WifiOffCuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: WifiOffCuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/world_2_cute_fi.tsx b/apps/mobile/src/icons/world_2_cute_fi.tsx new file mode 100644 index 000000000..40db9110e --- /dev/null +++ b/apps/mobile/src/icons/world_2_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface World2CuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const World2CuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: World2CuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/world_2_cute_re.tsx b/apps/mobile/src/icons/world_2_cute_re.tsx new file mode 100644 index 000000000..255f73e60 --- /dev/null +++ b/apps/mobile/src/icons/world_2_cute_re.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface World2CuteReIconProps { + width?: number + height?: number + color?: string +} + +export const World2CuteReIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: World2CuteReIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/icons/youtube_cute_fi.tsx b/apps/mobile/src/icons/youtube_cute_fi.tsx new file mode 100644 index 000000000..fac64989c --- /dev/null +++ b/apps/mobile/src/icons/youtube_cute_fi.tsx @@ -0,0 +1,26 @@ +import * as React from "react" +import Svg, { Path } from "react-native-svg" + +interface YoutubeCuteFiIconProps { + width?: number + height?: number + color?: string +} + +export const YoutubeCuteFiIcon = ({ + width = 24, + height = 24, + color = "#10161F", +}: YoutubeCuteFiIconProps) => { + return ( + + + + + ) +} diff --git a/apps/mobile/src/initialize/dayjs.ts b/apps/mobile/src/initialize/dayjs.ts new file mode 100644 index 000000000..353912f07 --- /dev/null +++ b/apps/mobile/src/initialize/dayjs.ts @@ -0,0 +1,10 @@ +import dayjs from "dayjs" +import duration from "dayjs/plugin/duration" +import localizedFormat from "dayjs/plugin/localizedFormat" +import relativeTime from "dayjs/plugin/relativeTime" +// Initialize dayjs +export const initializeDayjs = () => { + dayjs.extend(duration) + dayjs.extend(relativeTime) + dayjs.extend(localizedFormat) +} diff --git a/apps/mobile/src/initialize/hydrate.ts b/apps/mobile/src/initialize/hydrate.ts new file mode 100644 index 000000000..de93760db --- /dev/null +++ b/apps/mobile/src/initialize/hydrate.ts @@ -0,0 +1,2 @@ +export { hydrateDatabaseToStore } from "../services" +export const hydrateSettings = () => {} diff --git a/apps/mobile/src/initialize/index.ts b/apps/mobile/src/initialize/index.ts new file mode 100644 index 000000000..4a446b28b --- /dev/null +++ b/apps/mobile/src/initialize/index.ts @@ -0,0 +1,27 @@ +import { initializeDb } from "../database" +import { initializeDayjs } from "./dayjs" +import { hydrateDatabaseToStore, hydrateSettings } from "./hydrate" +import { migrateDatabase } from "./migration" +/* eslint-disable no-console */ +export const initializeApp = async () => { + console.log(`Initialize...`) + + const now = Date.now() + initializeDb() + await apm("migrateDatabase", migrateDatabase) + initializeDayjs() + + await apm("hydrateSettings", hydrateSettings) + await apm("hydrateDatabaseToStore", hydrateDatabaseToStore) + + const loadingTime = Date.now() - now + console.log(`Initialize done,`, `${loadingTime}ms`) +} + +const apm = async (label: string, fn: () => Promise | any) => { + const start = Date.now() + const result = await fn() + const end = Date.now() + console.log(`${label} took ${end - start}ms`) + return result +} diff --git a/apps/mobile/src/initialize/migration.ts b/apps/mobile/src/initialize/migration.ts new file mode 100644 index 000000000..e444dec46 --- /dev/null +++ b/apps/mobile/src/initialize/migration.ts @@ -0,0 +1,44 @@ +import { migrate } from "drizzle-orm/expo-sqlite/migrator" +import { useSyncExternalStore } from "react" + +import migrations from "@/drizzle/migrations" + +import { db } from "../database" + +let storeChangeFn: () => void +const subscribe = (onStoreChange: () => void) => { + storeChangeFn = onStoreChange + + return () => { + storeChangeFn = () => {} + } +} +const migrateStore = { + success: false, + error: null as Error | null, +} + +export const migrateDatabase = () => { + return migrate(db, migrations) + .then(() => { + migrateStore.success = true + storeChangeFn?.() + }) + .catch((error) => { + migrateStore.error = error + + console.error(error) + + storeChangeFn?.() + }) +} + +const getSnapshot = () => { + return migrateStore +} +const getServerSnapshot = () => { + return migrateStore +} +export const useDatabaseMigration = () => { + return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) +} diff --git a/apps/mobile/src/initialize/op.ts b/apps/mobile/src/initialize/op.ts new file mode 100644 index 000000000..0d912e273 --- /dev/null +++ b/apps/mobile/src/initialize/op.ts @@ -0,0 +1,9 @@ +import { OpenPanel } from "@openpanel/web" + +export const op = new OpenPanel({ + clientId: process.env.EXPO_PUBLIC_OPENPANEL_CLIENT_ID ?? "", + trackScreenViews: true, + trackOutgoingLinks: true, + trackAttributes: true, + apiUrl: process.env.EXPO_PUBLIC_OPENPANEL_API_URL, +}) diff --git a/apps/mobile/src/lib/api-fetch.ts b/apps/mobile/src/lib/api-fetch.ts new file mode 100644 index 000000000..05e5f03bc --- /dev/null +++ b/apps/mobile/src/lib/api-fetch.ts @@ -0,0 +1,59 @@ +/* eslint-disable no-console */ +import type { AppType } from "@follow/shared" +import { ofetch } from "ofetch" + +import { getApiUrl } from "./env" + +const { hc } = require("hono/dist/cjs/client/client") as typeof import("hono/client") + +export const apiFetch = ofetch.create({ + retry: false, + + baseURL: getApiUrl(), + onRequest: async ({ options, request }) => { + const header = new Headers(options.headers) + + header.set("x-app-name", "Follow Mobile") + + // const sessionToken = await getSessionToken() + // if (sessionToken.value) { + // // header.set("cookie", `better-auth.session_token=${sessionToken.value};`) + // } + if (__DEV__) { + // Logger + console.log(`---> ${options.method} ${request as string}`) + } + + options.headers = header + }, + onRequestError: ({ error, request, options }) => { + if (__DEV__) { + console.log(`[Error] ---> ${options.method} ${request as string}`) + } + console.error(error) + }, + + onResponse: ({ response, request, options }) => { + if (__DEV__) { + console.log(`<--- ${response.status} ${options.method} ${request as string}`) + } + }, + onResponseError: ({ error, request, options, response }) => { + if (__DEV__) { + console.log(`<--- [Error] ${response.status} ${options.method} ${request as string}`) + } + console.error(error) + }, +}) + +export const apiClient = hc(getApiUrl(), { + fetch: async (input: any, options = {}) => + apiFetch(input.toString(), options).catch((err) => { + throw err + }), + headers() { + return { + "X-App-Name": "Follow Mobile", + } + }, +}) diff --git a/apps/mobile/src/lib/auth.ts b/apps/mobile/src/lib/auth.ts new file mode 100644 index 000000000..ace016976 --- /dev/null +++ b/apps/mobile/src/lib/auth.ts @@ -0,0 +1,109 @@ +import { useQuery } from "@tanstack/react-query" +import type * as better_call from "better-call" +import { parse } from "cookie-es" + +import { getApiUrl } from "./env" +import { kv } from "./kv" +import { queryClient } from "./query-client" + +const { expoClient } = + require("@better-auth/expo/dist/client.js") as typeof import("@better-auth/expo/client") + +const { createAuthClient } = + require("better-auth/dist/react.js") as typeof import("better-auth/react") + +const storagePrefix = "follow_auth" +export const cookieKey = `${storagePrefix}_cookie` +export const sessionTokenKey = "__Secure-better-auth.session_token" + +const authClient = createAuthClient({ + baseURL: `${getApiUrl()}/better-auth`, + plugins: [ + { + id: "getProviders", + $InferServerPlugin: {} as (typeof authPlugins)[0], + }, + expoClient({ + scheme: "follow", + storagePrefix, + storage: { + setItem(key, value) { + kv.setSync(key, value) + if (key === cookieKey) { + queryClient.invalidateQueries({ queryKey: ["cookie"] }) + } + }, + getItem(key) { + return kv.getSync(key) + }, + }, + }), + ], +}) + +// @keep-sorted +export const { getCookie, getProviders, signIn, signOut, useSession } = authClient + +export interface AuthProvider { + name: string + id: string + color: string + icon: string +} + +export const useAuthProviders = () => { + return useQuery({ + queryKey: ["providers"], + queryFn: async () => (await getProviders()).data, + }) +} + +export const getSessionTokenFromCookie = () => { + const cookie = getCookie() + return cookie ? parse(cookie)[sessionTokenKey] : null +} + +export const useAuthToken = () => { + return useQuery({ + queryKey: ["cookie"], + queryFn: getSessionTokenFromCookie, + }) +} + +// eslint-disable-next-line unused-imports/no-unused-vars +declare const authPlugins: { + id: "getProviders" + endpoints: { + getProviders: { + < + C extends [ + ( + | better_call.Context< + "/get-providers", + { + method: "GET" + } + > + | undefined + )?, + ], + >( + ...ctx: C + ): Promise< + C extends [ + { + asResponse: true + }, + ] + ? Response + : Record + > + path: "/get-providers" + options: { + method: "GET" + } + method: better_call.Method | better_call.Method[] + headers: Headers + } + } +}[] diff --git a/apps/mobile/src/lib/cookie.ts b/apps/mobile/src/lib/cookie.ts new file mode 100644 index 000000000..60ffc2e9e --- /dev/null +++ b/apps/mobile/src/lib/cookie.ts @@ -0,0 +1,35 @@ +import CookieManager from "@react-native-cookies/cookies" + +import { cookieKey, getSessionTokenFromCookie, sessionTokenKey } from "./auth" +import { getApiUrl } from "./env" +import { kv } from "./kv" + +export const setSessionToken = (token: string) => { + kv.setSync( + cookieKey, + JSON.stringify({ + [sessionTokenKey]: { + value: token, + expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365).toISOString(), + }, + }), + ) + + return CookieManager.set(getApiUrl(), { + name: sessionTokenKey, + value: token, + httpOnly: true, + secure: true, + }) +} + +export const getSessionToken = async () => { + const cookies = await CookieManager.get(getApiUrl()) + + return cookies[sessionTokenKey] || getSessionTokenFromCookie() +} + +export const clearSessionToken = async () => { + await kv.delete(cookieKey) + return CookieManager.clearAll() +} diff --git a/apps/mobile/src/lib/env.ts b/apps/mobile/src/lib/env.ts new file mode 100644 index 000000000..c5a0f0ddc --- /dev/null +++ b/apps/mobile/src/lib/env.ts @@ -0,0 +1,12 @@ +import { getEnvironment } from "../atoms/env" +import { appEndpointMap } from "../constants/env" + +export const getApiUrl = () => { + const env = getEnvironment() + return appEndpointMap[env].api +} + +export const getWebUrl = () => { + const env = getEnvironment() + return appEndpointMap[env].web +} diff --git a/apps/mobile/src/lib/hooks/useOpenLink.ts b/apps/mobile/src/lib/hooks/useOpenLink.ts new file mode 100644 index 000000000..06a90b25f --- /dev/null +++ b/apps/mobile/src/lib/hooks/useOpenLink.ts @@ -0,0 +1,17 @@ +import * as WebBrowser from "expo-web-browser" +import { useCallback } from "react" + +// Ported from https://github.com/bluesky-social/social-app/blob/0c71f8196faf401dc9847b0bfb6559e5d7024940/src/lib/hooks/useOpenLink.ts +// License: MIT +export function useOpenLink() { + const openLink = useCallback(async (url: string) => { + WebBrowser.openBrowserAsync(url, { + presentationStyle: WebBrowser.WebBrowserPresentationStyle.PAGE_SHEET, + // toolbarColor: theme.atoms.bg.backgroundColor, + // controlsColor: theme.palette.primary_500, + createTask: false, + }) + }, []) + + return openLink +} diff --git a/apps/mobile/src/lib/jotai.ts b/apps/mobile/src/lib/jotai.ts new file mode 100644 index 000000000..95325686c --- /dev/null +++ b/apps/mobile/src/lib/jotai.ts @@ -0,0 +1,23 @@ +import Storage from "expo-sqlite/kv-store" +import type { SyncStorage } from "jotai/vanilla/utils/atomWithStorage" + +export { createAtomAccessor, createAtomHooks, jotaiStore } from "@follow/utils" + +export const JotaiPersistSyncStorage: SyncStorage = { + getItem: (key, defaultValue) => { + const res = Storage.getItemSync(key) + if (res === null) { + return defaultValue + } + return JSON.parse(res) + }, + setItem: (key, value) => { + return Storage.setItemSync(key, JSON.stringify(value)) + }, + removeItem: (key) => { + return Storage.removeItemSync(key) + }, + subscribe() { + return () => {} + }, +} diff --git a/apps/mobile/src/lib/kv.ts b/apps/mobile/src/lib/kv.ts new file mode 100644 index 000000000..532d6eed7 --- /dev/null +++ b/apps/mobile/src/lib/kv.ts @@ -0,0 +1,37 @@ +import Storage from "expo-sqlite/kv-store" + +class KV { + setSync(key: string, value: string) { + Storage.setItemSync(key, value) + } + + getSync(key: string) { + return Storage.getItemSync(key) + } + + set(key: string, value: string) { + Storage.setItem(key, value) + } + + get(key: string) { + return Storage.getItem(key) + } + + delete(key: string) { + return Storage.removeItem(key) + } + + clear() { + return Storage.clear() + } + + keys() { + return Storage.getAllKeysSync() + } + + [Symbol.iterator]() { + return Storage.getAllKeysSync().values() + } +} + +export const kv = new KV() diff --git a/apps/mobile/src/lib/query-client.ts b/apps/mobile/src/lib/query-client.ts new file mode 100644 index 000000000..944dbea12 --- /dev/null +++ b/apps/mobile/src/lib/query-client.ts @@ -0,0 +1,3 @@ +import { QueryClient } from "@tanstack/react-query" + +export const queryClient = new QueryClient() diff --git a/apps/mobile/src/lib/responsive.ts b/apps/mobile/src/lib/responsive.ts new file mode 100644 index 000000000..886ecb5d4 --- /dev/null +++ b/apps/mobile/src/lib/responsive.ts @@ -0,0 +1,47 @@ +import { useCallback } from "react" +import { Dimensions, useWindowDimensions } from "react-native" + +const baseWidth = 375 +const baseHeight = 812 +const windowDim = Dimensions.get("window") + +Dimensions.addEventListener("change", ({ window }) => { + Object.assign(windowDim, window) +}) +/** + * This scaleWidth is not responsive, it's just a simple scale util + * @param size + * @returns + */ +export const scaleWidth = (size: number) => { + return (size / baseWidth) * windowDim.width +} +/** + * This scaleHeight is not responsive, it's just a simple scale util + * @param size + * @returns + */ +export const scaleHeight = (size: number) => { + return (size / baseHeight) * windowDim.height +} +export const useScaleWidth = () => { + const windowDim = useWindowDimensions() + + return useCallback( + (size: number) => { + return (size / baseWidth) * windowDim.width + }, + [windowDim.width], + ) +} + +export const useScaleHeight = () => { + const windowDim = useWindowDimensions() + + return useCallback( + (size: number) => { + return (size / baseHeight) * windowDim.height + }, + [windowDim.height], + ) +} diff --git a/apps/mobile/src/main.ts b/apps/mobile/src/main.ts new file mode 100644 index 000000000..15ceea766 --- /dev/null +++ b/apps/mobile/src/main.ts @@ -0,0 +1,5 @@ +import { initializeApp } from "./initialize" + +initializeApp().then(() => { + require("expo-router/entry") +}) diff --git a/apps/mobile/src/modules/context-menu/feeds.tsx b/apps/mobile/src/modules/context-menu/feeds.tsx new file mode 100644 index 000000000..c8abae623 --- /dev/null +++ b/apps/mobile/src/modules/context-menu/feeds.tsx @@ -0,0 +1,222 @@ +import type { FeedViewType } from "@follow/constants" +import type { FC, PropsWithChildren } from "react" +import { useCallback, useMemo } from "react" +import type { NativeSyntheticEvent } from "react-native" +import { Alert, Clipboard } from "react-native" +import type { + ContextMenuAction, + ContextMenuOnPressNativeEvent, +} from "react-native-context-menu-view" +import { useEventCallback } from "usehooks-ts" + +import { ContextMenu } from "@/src/components/ui/context-menu" +import { views } from "@/src/constants/views" +import { getFeed } from "@/src/store/feed/getter" +import { getSubscription } from "@/src/store/subscription/getter" +import { useListSubscriptionCategory } from "@/src/store/subscription/hooks" +import { subscriptionSyncService } from "@/src/store/subscription/store" +import { unreadSyncService } from "@/src/store/unread/store" + +type Options = { + categories: string[] +} +const createFeedItemActions: (options: Options) => ContextMenuAction[] = (options) => { + return [ + { + title: "Mark All As Read", + }, + { + title: "Claim", + }, + { + title: "Boost", + }, + { + title: "Add To Category", + actions: [ + ...options.categories.map((category) => ({ + title: category, + })), + { + title: "Create New Category", + systemIcon: "plus", + }, + ], + }, + { + title: "Edit", + }, + { + title: "Copy Link", + }, + { + title: "Unsubscribe", + destructive: true, + }, + ] +} +export const SubscriptionFeedItemContextMenu: FC< + PropsWithChildren & { + id: string + view: FeedViewType + } +> = ({ id, children, view }) => { + const allCategories = useListSubscriptionCategory(view) + const actions = useMemo( + () => createFeedItemActions({ categories: allCategories }), + [allCategories], + ) + + return ( + ) => { + const [first, second] = e.nativeEvent.indexPath + + switch (first) { + case 0: { + unreadSyncService.markAsRead(id) + break + } + case 1: { + // TODO: implement logic + break + } + case 2: { + // TODO: implement logic + break + } + case 3: { + // add to category + + if (!actions[3].actions) break + const newCategory = second === actions[3].actions.length - 1 + const subscription = getSubscription(id) + + if (!subscription) return + if (newCategory) { + // create new category + Alert.prompt("Create New Category", "Enter the name of the new category", (text) => { + subscriptionSyncService.edit({ + ...subscription, + category: text, + }) + }) + } else { + // add to category + subscriptionSyncService.edit({ + ...subscription, + category: actions[3].actions[second].title, + }) + } + + break + } + case 4: { + // edit + break + } + case 5: { + // copy link + const subscription = getSubscription(id) + if (!subscription) return + + switch (subscription.type) { + case "feed": { + if (!subscription.feedId) return + const feed = getFeed(subscription.feedId) + if (!feed) return + Clipboard.setString(feed.url) + return + } + } + break + } + + case 6: { + // unsubscribe + Alert.alert("Unsubscribe?", "This will remove the feed from your list", [ + { + text: "Cancel", + style: "cancel", + }, + { + text: "Unsubscribe", + style: "destructive", + onPress: () => { + subscriptionSyncService.unsubscribe(id) + }, + }, + ]) + break + } + } + })} + > + {children} + + ) +} + +export const SubscriptionFeedCategoryContextMenu: FC< + { + category: string + feedIds: string[] + } & PropsWithChildren +> = ({ category: _, feedIds, children }) => { + return ( + [ + { + title: "Mark All As Read", + }, + { + title: "Change To Other View", + actions: views.map((view) => ({ + title: view.name, + })), + }, + { + title: "Edit Category", + }, + { + title: "Delete Category", + destructive: true, + }, + ], + [], + )} + onPress={useCallback( + (e: NativeSyntheticEvent) => { + const { name } = e.nativeEvent + const [first, second] = e.nativeEvent.indexPath + + if (first === 1) { + void second + // TODO change to other view + return + } + switch (name) { + case "Mark All As Read": { + unreadSyncService.markAsReadMany(feedIds) + break + } + case "Change To Other View": { + // TODO: implement logic + break + } + + case "Delete Category": { + // TODO: implement logic + break + } + } + }, + [feedIds], + )} + > + {children} + + ) +} diff --git a/apps/mobile/src/modules/context-menu/lists.tsx b/apps/mobile/src/modules/context-menu/lists.tsx new file mode 100644 index 000000000..f3efd9f10 --- /dev/null +++ b/apps/mobile/src/modules/context-menu/lists.tsx @@ -0,0 +1,78 @@ +import type { FC, PropsWithChildren } from "react" +import { useMemo } from "react" +import type { NativeSyntheticEvent } from "react-native" +import { Alert, Clipboard } from "react-native" +import type { + ContextMenuAction, + ContextMenuOnPressNativeEvent, +} from "react-native-context-menu-view" +import { useEventCallback } from "usehooks-ts" + +import { ContextMenu } from "@/src/components/ui/context-menu" +import { getWebUrl } from "@/src/lib/env" +import { getList } from "@/src/store/list/getters" +import { useIsOwnList } from "@/src/store/list/hooks" +import { subscriptionSyncService } from "@/src/store/subscription/store" + +export const SubscriptionListItemContextMenu: FC< + PropsWithChildren & { + id: string + } +> = ({ id, children }) => { + const isOwnList = useIsOwnList(id) + const actions = useMemo( + () => + [ + isOwnList && { + title: "Edit", + }, + { + title: "Copy Link", + }, + { + title: "Unsubscribe", + destructive: true, + }, + ].filter(Boolean) as ContextMenuAction[], + [isOwnList], + ) + return ( + ) => { + const { name } = e.nativeEvent + + switch (name) { + case "Edit": { + // TODO: implement + break + } + case "Copy Link": { + const list = getList(id) + if (!list) return + Clipboard.setString(`${getWebUrl()}/share/lists/${list.id}`) + break + } + case "Unsubscribe": { + Alert.alert("Unsubscribe", "Are you sure you want to unsubscribe?", [ + { + text: "Cancel", + style: "cancel", + }, + { + text: "Unsubscribe", + style: "destructive", + onPress: () => { + subscriptionSyncService.unsubscribe(id) + }, + }, + ]) + break + } + } + })} + > + {children} + + ) +} diff --git a/apps/mobile/src/modules/debug/index.tsx b/apps/mobile/src/modules/debug/index.tsx new file mode 100644 index 000000000..11724b74c --- /dev/null +++ b/apps/mobile/src/modules/debug/index.tsx @@ -0,0 +1,64 @@ +import { router } from "expo-router" +import { useRef, useState } from "react" +import { Animated, Dimensions, PanResponder } from "react-native" +import { useSafeAreaInsets } from "react-native-safe-area-context" + +import { BugCuteReIcon } from "@/src/icons/bug_cute_re" + +export const DebugButton = () => { + const insets = useSafeAreaInsets() + const windowWidth = Dimensions.get("window").width + const pan = useRef( + new Animated.ValueXY({ + x: insets.left, + y: 50, + }), + ).current + const [position, setPosition] = useState({ x: 0, y: 50 }) + + const panResponder = PanResponder.create({ + onStartShouldSetPanResponder: () => true, + onPanResponderMove: (_, gesture) => { + const newX = position.x + gesture.dx + const newY = position.y + gesture.dy + + pan.setValue({ x: newX, y: newY }) + }, + + onPanResponderRelease: (_, gesture) => { + if (Math.abs(gesture.dx) < 5 && Math.abs(gesture.dy) < 5) { + router.push("/debug") + + return + } + + const newY = position.y + gesture.dy + + const snapToLeft = true + const finalX = snapToLeft ? insets.left : windowWidth - 40 - insets.right + + Animated.spring(pan, { + toValue: { x: finalX, y: newY }, + useNativeDriver: false, + }).start() + + setPosition({ x: finalX, y: newY }) + }, + }) + + return ( + + + + ) +} diff --git a/apps/mobile/src/modules/login/email.tsx b/apps/mobile/src/modules/login/email.tsx new file mode 100644 index 000000000..7b4483795 --- /dev/null +++ b/apps/mobile/src/modules/login/email.tsx @@ -0,0 +1,91 @@ +import { zodResolver } from "@hookform/resolvers/zod" +import { useMutation } from "@tanstack/react-query" +import type { Control } from "react-hook-form" +import { useController, useForm } from "react-hook-form" +import type { TextInputProps } from "react-native" +import { ActivityIndicator, TextInput, TouchableOpacity, View } from "react-native" +import { z } from "zod" + +import { ThemedText } from "@/src/components/common/ThemedText" +import { signIn } from "@/src/lib/auth" + +const formSchema = z.object({ + email: z.string().email(), + password: z.string().min(8).max(128), +}) + +type FormValue = z.infer + +async function onSubmit(values: FormValue) { + await signIn.email({ + email: values.email, + password: values.password, + }) +} + +function Input({ + control, + name, + ...rest +}: TextInputProps & { + control: Control + name: keyof FormValue +}) { + const { field } = useController({ + control, + name, + }) + return +} + +export function EmailLogin() { + const { control, handleSubmit, formState } = useForm({ + resolver: zodResolver(formSchema), + defaultValues: { + email: "", + password: "", + }, + }) + + const submitMutation = useMutation({ + mutationFn: onSubmit, + }) + + return ( + + + + + + submitMutation.mutate(values))} + className="disabled:bg-gray-3 rounded-lg bg-accent p-3" + > + {submitMutation.isPending ? ( + + ) : ( + Continue with Email + )} + + + ) +} diff --git a/apps/mobile/src/modules/login/index.tsx b/apps/mobile/src/modules/login/index.tsx new file mode 100644 index 000000000..f98a3b650 --- /dev/null +++ b/apps/mobile/src/modules/login/index.tsx @@ -0,0 +1,35 @@ +import { TouchableWithoutFeedback, View } from "react-native" +import { KeyboardController } from "react-native-keyboard-controller" + +import { ThemedText } from "@/src/components/common/ThemedText" +import { Logo } from "@/src/components/ui/logo" + +import { EmailLogin } from "./email" +import { SocialLogin } from "./social" + +export function Login() { + return ( + + { + KeyboardController.dismiss() + }} + accessible={false} + > + + + Login to Follow + + + + + + + or + + + + + + ) +} diff --git a/apps/mobile/src/modules/login/social.tsx b/apps/mobile/src/modules/login/social.tsx new file mode 100644 index 000000000..631a88cd2 --- /dev/null +++ b/apps/mobile/src/modules/login/social.tsx @@ -0,0 +1,99 @@ +import * as AppleAuthentication from "expo-apple-authentication" +import { useColorScheme } from "nativewind" +import { Platform, TouchableOpacity, View } from "react-native" + +import { AppleCuteFiIcon } from "@/src/icons/apple_cute_fi" +import { GithubCuteFiIcon } from "@/src/icons/github_cute_fi" +import { GoogleCuteFiIcon } from "@/src/icons/google_cute_fi" +import { signIn, useAuthProviders } from "@/src/lib/auth" + +const provider: Record< + string, + { + id: string + color: string + darkColor: string + icon: (props: { width?: number; height?: number; color?: string }) => React.ReactNode + } +> = { + google: { + id: "google", + color: "#3b82f6", + darkColor: "#2563eb", + icon: GoogleCuteFiIcon, + }, + github: { + id: "github", + color: "#000000", + darkColor: "#ffffff", + icon: GithubCuteFiIcon, + }, + apple: { + id: "apple", + color: "#1f2937", + darkColor: "#ffffff", + icon: AppleCuteFiIcon, + }, +} + +export function SocialLogin() { + const { data } = useAuthProviders() + const { colorScheme } = useColorScheme() + + return ( + + {Object.keys(provider) + .filter((key) => key !== "apple" || (Platform.OS === "ios" && key === "apple")) + .map((key) => { + const providerInfo = provider[key] + return ( + { + if (!data?.[providerInfo.id]) return + + if (providerInfo.id === "apple") { + try { + const credential = await AppleAuthentication.signInAsync({ + requestedScopes: [ + AppleAuthentication.AppleAuthenticationScope.FULL_NAME, + AppleAuthentication.AppleAuthenticationScope.EMAIL, + ], + }) + + if (credential.identityToken) { + await signIn.social({ + provider: "apple", + idToken: { + token: credential.identityToken, + }, + }) + } else { + throw new Error("No identityToken.") + } + } catch (e) { + console.error(e) + // handle errors + } + return + } + + signIn.social({ + provider: providerInfo.id as any, + callbackURL: "/", + }) + }} + disabled={!data?.[providerInfo.id]} + > + + + ) + })} + + ) +} diff --git a/apps/mobile/src/modules/subscription/ViewTab.tsx b/apps/mobile/src/modules/subscription/ViewTab.tsx new file mode 100644 index 000000000..30cf0029e --- /dev/null +++ b/apps/mobile/src/modules/subscription/ViewTab.tsx @@ -0,0 +1,182 @@ +import { useHeaderHeight } from "@react-navigation/elements" +import { useAtomValue } from "jotai" +import { memo, useEffect, useRef, useState } from "react" +import type { TouchableOpacityProps } from "react-native" +import { ScrollView, StyleSheet, Text, TouchableOpacity, View } from "react-native" +import type { WithSpringConfig } from "react-native-reanimated" +import Animated, { useAnimatedStyle, useSharedValue, withSpring } from "react-native-reanimated" + +import { ThemedBlurView } from "@/src/components/common/ThemedBlurView" +import { ContextMenu } from "@/src/components/ui/context-menu" +import { bottomViewTabHeight } from "@/src/constants/ui" +import type { ViewDefinition } from "@/src/constants/views" +import { views } from "@/src/constants/views" +import { useUnreadCountByView } from "@/src/store/unread/hooks" +import { unreadSyncService } from "@/src/store/unread/store" + +import { offsetAtom, setCurrentView, viewAtom } from "./atoms" + +const springConfig: WithSpringConfig = { + damping: 20, + mass: 1, + stiffness: 120, +} +export const ViewTab = () => { + const headerHeight = useHeaderHeight() + const offset = useAtomValue(offsetAtom) + const currentView = useAtomValue(viewAtom) + const tabRef = useRef(null) + + const indicatorPosition = useSharedValue(0) + + const [tabWidths, setTabWidths] = useState([]) + const [tabPositions, setTabPositions] = useState([]) + const scrollOffsetX = useRef(0) + + useEffect(() => { + if (tabWidths.length > 0) { + indicatorPosition.value = withSpring(tabPositions[currentView] || 0, springConfig) + + if (tabRef.current) { + const x = currentView > 0 ? tabPositions[currentView - 1] + tabWidths[currentView - 1] : 0 + + const isCurrentTabVisible = + scrollOffsetX.current < tabPositions[currentView] && + scrollOffsetX.current + tabWidths[currentView] > tabPositions[currentView] + + if (!isCurrentTabVisible) { + tabRef.current.scrollTo({ x, y: 0, animated: true }) + } + } + } + }, [currentView, indicatorPosition, tabPositions, tabWidths]) + + const indicatorStyle = useAnimatedStyle(() => { + return { + transform: [ + { + translateX: indicatorPosition.value + 10 + Math.abs(offset), + }, + ], + backgroundColor: views[currentView].activeColor, + width: (tabWidths[currentView] || 20) - 40 + Math.abs(offset), + } + }) + + return ( + + + { + scrollOffsetX.current = event.nativeEvent.contentOffset.x + }} + showsHorizontalScrollIndicator={false} + className="border-tertiary-system-background" + horizontal + ref={tabRef} + contentContainerStyle={styles.tabScroller} + style={styles.root} + > + {views.map((view, index) => { + const isSelected = currentView === view.view + return ( + { + const { width, x } = event.nativeEvent.layout + setTabWidths((prev) => { + const newWidths = [...prev] + newWidths[index] = width + return newWidths + }) + setTabPositions((prev) => { + const newPositions = [...prev] + newPositions[index] = x + return newPositions + }) + }} + /> + ) + })} + + + + + ) +} + +const TabItem = memo( + ({ + isSelected, + view, + onLayout, + }: { isSelected: boolean; view: ViewDefinition } & Pick) => { + const unreadCount = useUnreadCountByView(view.view) + return ( + { + switch (e.nativeEvent.index) { + case 0: { + unreadSyncService.markViewAsRead(view.view) + break + } + } + }} + onLayout={onLayout} + > + setCurrentView(view.view)} + className="relative mr-4 flex-row items-center justify-center" + > + + + {view.name} + + {unreadCount > 0 && ( + + + {unreadCount > 99 ? "99+" : unreadCount} + + + )} + + + ) + }, +) +const styles = StyleSheet.create({ + indicator: { + position: "absolute", + bottom: 0, + height: 2, + borderRadius: 1, + }, + tabContainer: { + backgroundColor: "transparent", + bottom: 0, + left: 0, + position: "absolute", + width: "100%", + top: 0, + }, + tabScroller: { + alignItems: "center", + flexDirection: "row", + paddingHorizontal: 4, + }, + + root: { paddingHorizontal: 6 }, +}) diff --git a/apps/mobile/src/modules/subscription/atoms.ts b/apps/mobile/src/modules/subscription/atoms.ts new file mode 100644 index 000000000..d6d51c780 --- /dev/null +++ b/apps/mobile/src/modules/subscription/atoms.ts @@ -0,0 +1,44 @@ +import { FeedViewType } from "@follow/constants" +import { createAtomHooks, jotaiStore } from "@follow/utils" +import { atom, useAtomValue } from "jotai" +import { atomWithStorage } from "jotai/utils" + +import { JotaiPersistSyncStorage } from "@/src/lib/jotai" + +export const viewAtom = atom(FeedViewType.Articles) + +export const useCurrentView = () => { + return useAtomValue(viewAtom) +} + +export const offsetAtom = atom(0) + +export const setCurrentView = (view: FeedViewType) => { + jotaiStore.set(viewAtom, view) +} + +export const [ + , + , + useFeedListSortMethod, + useSetFeedListSortMethod, + getFeedListSortMethod, + setFeedListSortMethod, +] = createAtomHooks( + atomWithStorage<"alphabet" | "count">("listSortMethod", "alphabet", JotaiPersistSyncStorage, { + getOnInit: true, + }), +) + +export const [ + , + , + useFeedListSortOrder, + useSetFeedListSortOrder, + getFeedListSortOrder, + setFeedListSortOrder, +] = createAtomHooks( + atomWithStorage<"asc" | "desc">("listSortOrder", "asc", JotaiPersistSyncStorage, { + getOnInit: true, + }), +) diff --git a/apps/mobile/src/modules/subscription/ctx.ts b/apps/mobile/src/modules/subscription/ctx.ts new file mode 100644 index 000000000..70d178c99 --- /dev/null +++ b/apps/mobile/src/modules/subscription/ctx.ts @@ -0,0 +1,6 @@ +import type { FeedViewType } from "@follow/constants" +import { createContext, useContext } from "react" + +const ViewPageCurrentViewContext = createContext(null!) +export const ViewPageCurrentViewProvider = ViewPageCurrentViewContext.Provider +export const useViewPageCurrentView = () => useContext(ViewPageCurrentViewContext) diff --git a/apps/mobile/src/modules/subscription/header-actions.tsx b/apps/mobile/src/modules/subscription/header-actions.tsx new file mode 100644 index 000000000..b98156bfc --- /dev/null +++ b/apps/mobile/src/modules/subscription/header-actions.tsx @@ -0,0 +1,79 @@ +import { TouchableOpacity } from "react-native" +import type { ContextMenuAction } from "react-native-context-menu-view" + +import { ContextMenu } from "@/src/components/ui/context-menu" +import { AZSortAscendingLettersCuteReIcon } from "@/src/icons/AZ_sort_ascending_letters_cute_re" +import { AZSortDescendingLettersCuteReIcon } from "@/src/icons/AZ_sort_descending_letters_cute_re" +import { Numbers90SortAscendingCuteReIcon } from "@/src/icons/numbers_90_sort_ascending_cute_re" +import { Numbers90SortDescendingCuteReIcon } from "@/src/icons/numbers_90_sort_descending_cute_re" +import { accentColor } from "@/src/theme/colors" + +import { + setFeedListSortMethod, + setFeedListSortOrder, + useFeedListSortMethod, + useFeedListSortOrder, +} from "./atoms" + +const map = { + alphabet: { + asc: AZSortAscendingLettersCuteReIcon, + desc: AZSortDescendingLettersCuteReIcon, + }, + count: { + desc: Numbers90SortDescendingCuteReIcon, + asc: Numbers90SortAscendingCuteReIcon, + }, +} + +export const SortActionButton = () => { + const sortMethod = useFeedListSortMethod() + const sortOrder = useFeedListSortOrder() + + const orderActions: ContextMenuAction[] = [ + { title: "Ascending", selected: sortOrder === "asc" }, + { title: "Descending", selected: sortOrder === "desc" }, + ] + + const actions: ContextMenuAction[] = [ + { title: "Alphabet", actions: orderActions, selected: sortMethod === "alphabet" }, + { title: "Unread Count", actions: orderActions, selected: sortMethod === "count" }, + ] + + const Icon = map[sortMethod][sortOrder] + return ( + { + const [firstArgs, secondary] = e.nativeEvent.indexPath + + switch (firstArgs) { + case 0: { + setFeedListSortMethod("alphabet") + break + } + case 1: { + setFeedListSortMethod("count") + break + } + } + + switch (secondary) { + case 0: { + setFeedListSortOrder("asc") + break + } + case 1: { + setFeedListSortOrder("desc") + break + } + } + }} + > + + + + + ) +} diff --git a/apps/mobile/src/modules/subscription/list.tsx b/apps/mobile/src/modules/subscription/list.tsx new file mode 100644 index 000000000..d272021ab --- /dev/null +++ b/apps/mobile/src/modules/subscription/list.tsx @@ -0,0 +1,455 @@ +import { FeedViewType } from "@follow/constants" +import { cn } from "@follow/utils" +import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs" +import { useHeaderHeight } from "@react-navigation/elements" +import { FlashList } from "@shopify/flash-list" +import { router } from "expo-router" +import { useAtom } from "jotai" +import { useColorScheme } from "nativewind" +import type { FC } from "react" +import { createContext, memo, useContext, useEffect, useRef } from "react" +import { + Animated, + Easing, + Image, + StyleSheet, + Text, + TouchableOpacity, + useAnimatedValue, + View, +} from "react-native" +import PagerView from "react-native-pager-view" +import { useSharedValue } from "react-native-reanimated" +import { useSafeAreaInsets } from "react-native-safe-area-context" + +import { AccordionItem } from "@/src/components/ui/accordion" +import { FallbackIcon } from "@/src/components/ui/icon/fallback-icon" +import { FeedIcon } from "@/src/components/ui/icon/feed-icon" +import { ItemPressable } from "@/src/components/ui/pressable/item-pressable" +import { bottomViewTabHeight } from "@/src/constants/ui" +import { InboxCuteFiIcon } from "@/src/icons/inbox_cute_fi" +import { MingcuteRightLine } from "@/src/icons/mingcute_right_line" +import { StarCuteFiIcon } from "@/src/icons/star_cute_fi" +import { useFeed } from "@/src/store/feed/hooks" +import { useList } from "@/src/store/list/hooks" +import { + useGroupedSubscription, + useInboxSubscription, + useListSubscription, + usePrefetchSubscription, + useSortedGroupedSubscription, + useSortedListSubscription, + useSortedUngroupedSubscription, + useSubscription, +} from "@/src/store/subscription/hooks" +import { getInboxStoreId } from "@/src/store/subscription/utils" +import { useUnreadCount, useUnreadCounts } from "@/src/store/unread/hooks" + +import { + SubscriptionFeedCategoryContextMenu, + SubscriptionFeedItemContextMenu, +} from "../context-menu/feeds" +import { SubscriptionListItemContextMenu } from "../context-menu/lists" +import { useFeedListSortMethod, useFeedListSortOrder, viewAtom } from "./atoms" +import { useViewPageCurrentView, ViewPageCurrentViewProvider } from "./ctx" + +export const SubscriptionList = memo(() => { + const [currentView, setCurrentView] = useAtom(viewAtom) + + const pagerRef = useRef(null) + + useEffect(() => { + pagerRef.current?.setPage(currentView) + }, [currentView]) + + return ( + <> + + + { + setCurrentView(nativeEvent.position) + }} + scrollEnabled + style={style.flex} + initialPage={0} + ref={pagerRef} + offscreenPageLimit={3} + > + {[ + FeedViewType.Articles, + FeedViewType.SocialMedia, + FeedViewType.Pictures, + FeedViewType.Videos, + FeedViewType.Audios, + FeedViewType.Notifications, + ].map((view) => { + return ( + + + + ) + })} + + + ) +}) +const RecycleList = ({ view }: { view: FeedViewType }) => { + const headerHeight = useHeaderHeight() + const insets = useSafeAreaInsets() + const tabHeight = useBottomTabBarHeight() + + usePrefetchSubscription(view) + const { grouped, unGrouped } = useGroupedSubscription(view) + + const sortBy = useFeedListSortMethod() + const sortOrder = useFeedListSortOrder() + const sortedGrouped = useSortedGroupedSubscription(grouped, sortBy, sortOrder) + const sortedUnGrouped = useSortedUngroupedSubscription(unGrouped, sortBy, sortOrder) + const data = [...sortedGrouped, ...sortedUnGrouped] + + return ( + + ) +} + +const ItemRender = ({ + item, + index, + extraData, +}: { + item: string | { category: string; subscriptionIds: string[] } + index: number + extraData?: { + total: number + } +}) => { + if (typeof item === "string") { + return ( + + ) + } + const { category, subscriptionIds } = item + + return +} + +const ListHeaderComponent = () => { + const view = useViewPageCurrentView() + + return ( + <> + + {view === FeedViewType.Articles && } + + Feeds + + ) +} + +// This not used FlashList +// const ViewPage = memo(({ view }: { view: FeedViewType }) => { +// const { grouped, unGrouped } = useGroupedSubscription(view) +// usePrefetchSubscription(view) + +// return ( +// +// +// {view === FeedViewType.Articles && } +// +// Feeds +// +// +// +// ) +// }) + +const InboxList = () => { + const inboxes = useInboxSubscription(FeedViewType.Articles) + if (inboxes.length === 0) return null + return ( + + Inboxes + {inboxes.map((id) => { + return + })} + + ) +} + +const InboxItem = memo(({ id }: { id: string }) => { + const subscription = useSubscription(getInboxStoreId(id)) + const unreadCount = useUnreadCount(id) + const { colorScheme } = useColorScheme() + if (!subscription) return null + return ( + + + + + + {subscription.title} + {!!unreadCount && {unreadCount}} + + ) +}) + +const StarItem = () => { + return ( + { + // TODO + }} + className="mt-4 h-12 w-full flex-row items-center px-3" + > + + Collections + + ) +} + +const ListList = () => { + const currentView = useViewPageCurrentView() + const listIds = useListSubscription(currentView) + const sortedListIds = useSortedListSubscription(listIds, "alphabet") + if (sortedListIds.length === 0) return null + return ( + + Lists + {sortedListIds.map((id) => { + return + })} + + ) +} + +const ListSubscriptionItem = memo(({ id }: { id: string; className?: string }) => { + const list = useList(id) + const unreadCount = useUnreadCount(id) + if (!list) return null + return ( + + + + {!!list.image && ( + + )} + {!list.image && } + + + {list.title} + {!!unreadCount && } + + + ) +}) + +const UnGroupedList: FC<{ + subscriptionIds: string[] +}> = ({ subscriptionIds }) => { + const sortBy = useFeedListSortMethod() + const sortOrder = useFeedListSortOrder() + const sortedSubscriptionIds = useSortedUngroupedSubscription(subscriptionIds, sortBy, sortOrder) + const lastSubscriptionId = sortedSubscriptionIds.at(-1) + + return sortedSubscriptionIds.map((id) => { + return ( + + ) + }) +} + +const GroupedContext = createContext(null) + +const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity) + +// const CategoryList: FC<{ +// grouped: Record +// }> = ({ grouped }) => { +// const sortedGrouped = useSortedGroupedSubscription(grouped, "alphabet") + +// return sortedGrouped.map(({ category, subscriptionIds }) => { +// return +// }) +// } + +const CategoryGrouped = memo( + ({ category, subscriptionIds }: { category: string; subscriptionIds: string[] }) => { + const unreadCounts = useUnreadCounts(subscriptionIds) + const isExpanded = useSharedValue(false) + const rotateValue = useAnimatedValue(1) + return ( + + { + // TODO navigate to category + }} + className="border-secondary-system-grouped-background border-b-hairline h-12 flex-row items-center px-3" + > + { + Animated.timing(rotateValue, { + toValue: isExpanded.value ? 1 : 0, + easing: Easing.linear, + + useNativeDriver: true, + }).start() + isExpanded.value = !isExpanded.value + }} + style={[ + { + transform: [ + { + rotate: rotateValue.interpolate({ + inputRange: [0, 1], + outputRange: ["90deg", "0deg"], + }), + }, + ], + }, + style.accordionIcon, + ]} + > + + + {category} + {!!unreadCounts && ( + {unreadCounts} + )} + + + + + + + + ) + }, +) + +// const renderRightActions = () => { +// return ( +// +// { +// // TODO: Handle unsubscribe +// }} +// > +// Unsubscribe +// +// +// ) +// } + +// const renderLeftActions = () => { +// return ( +// +// { +// // TODO: Handle unsubscribe +// }} +// > +// Read +// +// +// ) +// } + +// let prevOpenedRow: SwipeableMethods | null = null +const SubscriptionItem = memo(({ id, className }: { id: string; className?: string }) => { + const subscription = useSubscription(id) + const unreadCount = useUnreadCount(id) + const feed = useFeed(id) + const inGrouped = !!useContext(GroupedContext) + const view = useViewPageCurrentView() + // const swipeableRef: SwipeableRef = useRef(null) + + if (!subscription || !feed) return null + + return ( + // FIXME: Here leads to very serious performance issues, the frame rate of both the UI and JS threads has dropped + // { + // if (prevOpenedRow && prevOpenedRow !== swipeableRef.current) { + // prevOpenedRow.close() + // } + // prevOpenedRow = swipeableRef.current + // }} + // > + + { + router.push({ + pathname: `/feeds/[feedId]`, + params: { + feedId: id, + }, + }) + }} + > + + + + {subscription.title || feed.title} + {!!unreadCount && ( + {unreadCount} + )} + + + // + ) +}) + +const style = StyleSheet.create({ + flex: { + flex: 1, + }, + accordionIcon: { + height: 20, + width: 20, + alignItems: "center", + justifyContent: "center", + }, +}) diff --git a/apps/mobile/src/morph/db-store.ts b/apps/mobile/src/morph/db-store.ts new file mode 100644 index 000000000..e54d126c5 --- /dev/null +++ b/apps/mobile/src/morph/db-store.ts @@ -0,0 +1,13 @@ +import type { SubscriptionSchema } from "../database/schemas/types" +import type { SubscriptionModel } from "../store/subscription/store" + +class DbStoreMorph { + toSubscriptionModel(subscription: SubscriptionSchema): SubscriptionModel { + return { + ...subscription, + isPrivate: subscription.isPrivate ? true : false, + } + } +} + +export const dbStoreMorph = new DbStoreMorph() diff --git a/apps/mobile/src/morph/hono.ts b/apps/mobile/src/morph/hono.ts new file mode 100644 index 000000000..daba26a2d --- /dev/null +++ b/apps/mobile/src/morph/hono.ts @@ -0,0 +1,84 @@ +import type { FeedSchema, InboxSchema } from "../database/schemas/types" +import type { ListModel } from "../store/list/store" +import type { SubscriptionModel } from "../store/subscription/store" +import type { HonoApiClient } from "./types" + +class Morph { + toSubscription(data: HonoApiClient.Subscription_Get) { + const subscriptions: SubscriptionModel[] = [] + + // TODO list inbox + const collections = { + feeds: [], + inboxes: [], + lists: [], + } as { + feeds: FeedSchema[] + inboxes: InboxSchema[] + lists: ListModel[] + } + + for (const item of data) { + const baseSubscription = { + category: item.category!, + + userId: item.userId, + view: item.view, + isPrivate: item.isPrivate, + title: item.title, + createdAt: item.createdAt, + } as SubscriptionModel + + if ("feeds" in item) { + baseSubscription.feedId = item.feedId + baseSubscription.type = "feed" + const feed = item.feeds + collections.feeds.push({ + description: feed.description!, + id: feed.id, + errorAt: feed.errorAt!, + errorMessage: feed.errorMessage!, + image: feed.image!, + ownerUserId: feed.ownerUserId!, + siteUrl: feed.siteUrl!, + title: feed.title!, + url: feed.url, + }) + } + + if ("inboxes" in item) { + baseSubscription.inboxId = item.inboxId + baseSubscription.type = "inbox" + const inbox = item.inboxes + + collections.inboxes.push({ + id: inbox.id, + title: inbox.title!, + }) + } + + if ("lists" in item) { + baseSubscription.listId = item.listId + baseSubscription.type = "list" + const list = item.lists + if (list.owner) + collections.lists.push({ + id: list.id, + title: list.title!, + userId: list.owner!.id, + description: list.description!, + view: list.view, + image: list.image!, + ownerUserId: list.owner.id, + feedIds: list.feedIds!, + fee: list.fee!, + }) + } + + subscriptions.push(baseSubscription) + } + return { subscriptions, ...collections } + } +} + +export const honoMorph = new Morph() diff --git a/apps/mobile/src/morph/store-db.ts b/apps/mobile/src/morph/store-db.ts new file mode 100644 index 000000000..e1ab6b0f3 --- /dev/null +++ b/apps/mobile/src/morph/store-db.ts @@ -0,0 +1,28 @@ +import type { ListSchema, SubscriptionSchema } from "../database/schemas/types" +import type { ListModel } from "../store/list/store" +import type { SubscriptionModel } from "../store/subscription/store" + +class StoreDbMorph { + toListSchema(list: ListModel): ListSchema { + return { + ...list, + feedIds: JSON.stringify(list.feedIds), + } + } + toSubscriptionSchema(subscription: SubscriptionModel): SubscriptionSchema { + return { + ...subscription, + id: buildSubscriptionDbId(subscription), + isPrivate: subscription.isPrivate ? 1 : 0, + } + } +} + +export const storeDbMorph = new StoreDbMorph() + +const buildSubscriptionDbId = (subscription: SubscriptionModel) => { + if (subscription.feedId) return `${subscription.type}/${subscription.feedId}` + if (subscription.listId) return `${subscription.type}/${subscription.listId}` + if (subscription.inboxId) return `${subscription.type}/${subscription.inboxId}` + throw new Error("Invalid subscription") +} diff --git a/apps/mobile/src/morph/types.ts b/apps/mobile/src/morph/types.ts new file mode 100644 index 000000000..7836b0b6b --- /dev/null +++ b/apps/mobile/src/morph/types.ts @@ -0,0 +1,10 @@ +/* eslint-disable @typescript-eslint/no-namespace */ +import type { apiClient } from "../lib/api-fetch" + +// Add ExtractData type utility +type ExtractData any> = + Awaited> extends { data: infer D } ? D : never + +export namespace HonoApiClient { + export type Subscription_Get = ExtractData +} diff --git a/apps/mobile/src/providers/index.tsx b/apps/mobile/src/providers/index.tsx new file mode 100644 index 000000000..d7a78aa8f --- /dev/null +++ b/apps/mobile/src/providers/index.tsx @@ -0,0 +1,43 @@ +import { jotaiStore } from "@follow/utils" +import { ThemeProvider } from "@react-navigation/native" +import { QueryClientProvider } from "@tanstack/react-query" +import { useDrizzleStudio } from "expo-drizzle-studio-plugin" +import { Provider } from "jotai" +import { useColorScheme } from "nativewind" +import type { ReactNode } from "react" +import { StyleSheet, View } from "react-native" +import { GestureHandlerRootView } from "react-native-gesture-handler" +import { KeyboardProvider } from "react-native-keyboard-controller" + +import { sqlite } from "../database" +import { queryClient } from "../lib/query-client" +import { getCurrentColors } from "../theme/colors" +import { DarkTheme, DefaultTheme } from "../theme/navigation" +import { MigrationProvider } from "./migration" + +export const RootProviders = ({ children }: { children: ReactNode }) => { + useDrizzleStudio(sqlite) + const { colorScheme } = useColorScheme() + + const currentThemeColors = getCurrentColors()! + + return ( + + + + + + + {children} + + + + + + + ) +} + +const styles = StyleSheet.create({ + flex: { flex: 1 }, +}) diff --git a/apps/mobile/src/providers/migration.tsx b/apps/mobile/src/providers/migration.tsx new file mode 100644 index 000000000..d620302c9 --- /dev/null +++ b/apps/mobile/src/providers/migration.tsx @@ -0,0 +1,46 @@ +import { deleteAsync } from "expo-file-system" +import type { ReactNode } from "react" +import { Button, Text, View } from "react-native" + +import { LoadingIndicator } from "../components/ui/loading" +import { getDbPath } from "../database" +import { BugCuteReIcon } from "../icons/bug_cute_re" +import { useDatabaseMigration } from "../initialize/migration" + +export const MigrationProvider = ({ children }: { children: ReactNode }) => { + const { success, error } = useDatabaseMigration() + + if (error) { + return ( + + + Oops, something went wrong... + + {error.message} + + + + + + + ) +} + +const registerFormSchema = z + .object({ + email: z.string().email(), + password: z.string().min(8).max(128), + confirmPassword: z.string(), + }) + .refine((data) => data.password === data.confirmPassword, { + message: "Passwords don't match", + path: ["confirmPassword"], + }) + +function RegisterForm() { + const { t } = useTranslation("app") + + const form = useForm>({ + resolver: zodResolver(registerFormSchema), + defaultValues: { + email: "", + password: "", + confirmPassword: "", + }, + }) + + const { isValid } = form.formState + + function onSubmit(values: z.infer) { + return signUp.email({ + email: values.email, + password: values.password, + name: values.email.split("@")[0], + callbackURL: "/", + fetchOptions: { + onSuccess() { + window.location.reload() + }, + onError(context) { + toast.error(context.error.message) + }, + }, + }) + } + + return ( +
+
+ + ( + + {t("register.email")} + + + + + + )} + /> + ( + + {t("register.password")} + + + + + + )} + /> + ( + + {t("register.confirm_password")} + + + + + + )} + /> + + + +
+ ) +} diff --git a/apps/renderer/src/modules/auth/LoginModalContent.tsx b/apps/renderer/src/modules/auth/LoginModalContent.tsx index 885cdc9d0..6cff44b31 100644 --- a/apps/renderer/src/modules/auth/LoginModalContent.tsx +++ b/apps/renderer/src/modules/auth/LoginModalContent.tsx @@ -12,10 +12,12 @@ import type { FC } from "react" import { useEffect, useMemo, useRef, useState } from "react" import { useTranslation } from "react-i18next" -import { useCurrentModal } from "~/components/ui/modal/stacked/hooks" +import { useCurrentModal, useModalStack } from "~/components/ui/modal/stacked/hooks" import type { AuthProvider } from "~/queries/users" import { useAuthProviders } from "~/queries/users" +import { LoginWithPassword } from "./Form" + interface LoginModalContentProps { runtime?: LoginRuntime canClose?: boolean @@ -35,9 +37,12 @@ const defaultProviders = { icon: '', }, } + const overrideProviderIconMap = { apple: , + credential: , } + export const LoginModalContent = (props: LoginModalContentProps) => { const modal = useCurrentModal() @@ -193,7 +198,9 @@ export const AuthProvidersRender: FC<{ providers: AuthProvider[] runtime?: LoginRuntime }> = ({ providers, runtime }) => { + const { t } = useTranslation() const [authProcessingLockSet, setAuthProcessingLockSet] = useState(() => new Set()) + const { present } = useModalStack() return ( {providers.length > 0 && ( @@ -204,6 +211,14 @@ export const AuthProvidersRender: FC<{ disabled={authProcessingLockSet.has(provider.id)} onClick={() => { if (authProcessingLockSet.has(provider.id)) return + + if (provider.id === "credential") { + present({ + content: () => , + title: t("login.with_email.title"), + }) + return + } loginHandler(provider.id, runtime) setAuthProcessingLockSet((prev) => { diff --git a/apps/renderer/src/modules/boost/boost-progress.tsx b/apps/renderer/src/modules/boost/boost-progress.tsx index 82b4bec93..82434c729 100644 --- a/apps/renderer/src/modules/boost/boost-progress.tsx +++ b/apps/renderer/src/modules/boost/boost-progress.tsx @@ -27,7 +27,7 @@ export const BoostProgress = ({
void + fn: (data: { userId?: string | null; feedId?: string; entryId?: string }) => void }> export type StarCommand = Command<{ diff --git a/apps/renderer/src/modules/discover/list-form.tsx b/apps/renderer/src/modules/discover/list-form.tsx index 15a4b3432..aa2729398 100644 --- a/apps/renderer/src/modules/discover/list-form.tsx +++ b/apps/renderer/src/modules/discover/list-form.tsx @@ -74,7 +74,9 @@ export const ListForm: Component<{
{!asWidget && ( diff --git a/apps/renderer/src/modules/entry-column/Items/audio-item.tsx b/apps/renderer/src/modules/entry-column/Items/audio-item.tsx index 9f3cd26b2..8d01b9b7c 100644 --- a/apps/renderer/src/modules/entry-column/Items/audio-item.tsx +++ b/apps/renderer/src/modules/entry-column/Items/audio-item.tsx @@ -64,15 +64,15 @@ export const AudioItemSkeleton = (
· - +
- - + +
- +
diff --git a/apps/renderer/src/modules/entry-column/Items/notification-item.tsx b/apps/renderer/src/modules/entry-column/Items/notification-item.tsx index e2941f75c..6f5420718 100644 --- a/apps/renderer/src/modules/entry-column/Items/notification-item.tsx +++ b/apps/renderer/src/modules/entry-column/Items/notification-item.tsx @@ -36,13 +36,13 @@ export const NotificationItemSkeleton = (
- + · - +
- - + +
diff --git a/apps/renderer/src/modules/entry-column/Items/picture-item.tsx b/apps/renderer/src/modules/entry-column/Items/picture-item.tsx index 903d13500..ff535b1b2 100644 --- a/apps/renderer/src/modules/entry-column/Items/picture-item.tsx +++ b/apps/renderer/src/modules/entry-column/Items/picture-item.tsx @@ -50,7 +50,7 @@ export function PictureItem({ entryId, entryPreview, translation }: UniversalIte }} /> ) : ( -
+
{t("entry_content.no_content")}
diff --git a/apps/renderer/src/modules/entry-column/Items/social-media-item.tsx b/apps/renderer/src/modules/entry-column/Items/social-media-item.tsx index 98db5a781..bcee672f7 100644 --- a/apps/renderer/src/modules/entry-column/Items/social-media-item.tsx +++ b/apps/renderer/src/modules/entry-column/Items/social-media-item.tsx @@ -200,18 +200,18 @@ export const SocialMediaItemSkeleton = (
- + · - +
- - - + + +
- +
@@ -286,8 +286,7 @@ const SocialMediaGallery = ({ media }: { media: MediaModel[] }) => { className="size-28 shrink-0 data-[state=loading]:!bg-theme-placeholder-image" loading="lazy" proxy={proxySize} - onClick={(e) => { - e.stopPropagation() + onClick={() => { previewMedia( mediaList.map((m) => ({ url: m.url, @@ -337,8 +336,7 @@ const SocialMediaGallery = ({ media }: { media: MediaModel[] }) => { className="aspect-square w-full rounded object-cover" loading="lazy" proxy={proxySize} - onClick={(e) => { - e.stopPropagation() + onClick={() => { previewMedia( media.map((m) => ({ url: m.url, diff --git a/apps/renderer/src/modules/entry-column/Items/video-item.tsx b/apps/renderer/src/modules/entry-column/Items/video-item.tsx index d645530f2..7cef35c09 100644 --- a/apps/renderer/src/modules/entry-column/Items/video-item.tsx +++ b/apps/renderer/src/modules/entry-column/Items/video-item.tsx @@ -2,6 +2,7 @@ import { isMobile } from "@follow/components/hooks/useMobile.js" import { Skeleton } from "@follow/components/ui/skeleton/index.jsx" import { IN_ELECTRON } from "@follow/shared/constants" import { stopPropagation } from "@follow/utils/dom" +import { transformVideoUrl } from "@follow/utils/url-for-video" import { cn } from "@follow/utils/utils" import { useHover } from "@use-gesture/react" import { useEffect, useMemo, useRef, useState } from "react" @@ -16,7 +17,6 @@ import { FixedModalCloseButton } from "~/components/ui/modal/components/close" import { PlainModal } from "~/components/ui/modal/stacked/custom-modal" import { useModalStack } from "~/components/ui/modal/stacked/hooks" import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams" -import { urlToIframe } from "~/lib/url-to-iframe" import { FeedIcon } from "~/modules/feed/feed-icon" import { FeedTitle } from "~/modules/feed/feed-title" import { useEntry } from "~/store/entry/hooks" @@ -32,7 +32,17 @@ export function VideoItem({ entryId, entryPreview, translation }: UniversalItemP const isActive = useRouteParamsSelector(({ entryId }) => entryId === entry?.entries.id) const [miniIframeSrc, iframeSrc] = useMemo( - () => [urlToIframe(entry?.entries.url, true), urlToIframe(entry?.entries.url)], + () => [ + transformVideoUrl({ + url: entry?.entries.url ?? "", + mini: true, + isIframe: !IN_ELECTRON, + }), + transformVideoUrl({ + url: entry?.entries.url ?? "", + isIframe: !IN_ELECTRON, + }), + ], [entry?.entries.url], ) const modalStack = useModalStack() @@ -218,13 +228,13 @@ export const VideoItemSkeleton = (
- +
- + · - +
diff --git a/apps/renderer/src/modules/entry-column/grid.tsx b/apps/renderer/src/modules/entry-column/grid.tsx index 6c17864b1..5ccf4cc8e 100644 --- a/apps/renderer/src/modules/entry-column/grid.tsx +++ b/apps/renderer/src/modules/entry-column/grid.tsx @@ -271,7 +271,7 @@ const VirtualGridImpl: FC< return (
{!withAudio && }
{!!estimatedMins && ( -
+
{ >({ resolver: zodResolver(formSchema), defaultValues: { - handle: user?.handle || "", + handle: user?.handle || undefined, name: user?.name || "", image: user?.image || "", }, diff --git a/apps/renderer/src/modules/settings/tabs/about.tsx b/apps/renderer/src/modules/settings/tabs/about.tsx index 9ff150eb2..dc3af5cd5 100644 --- a/apps/renderer/src/modules/settings/tabs/about.tsx +++ b/apps/renderer/src/modules/settings/tabs/about.tsx @@ -33,7 +33,9 @@ export const SettingAbout = () => { {APP_NAME} {!import.meta.env.PROD ? `(${import.meta.env.MODE})` : ""}
- app: {appVersion} + {appVersion && ( + app: {appVersion} + )} {rendererVersion && ( renderer: {rendererVersion} diff --git a/apps/renderer/src/modules/trending/index.tsx b/apps/renderer/src/modules/trending/index.tsx index 870fb63bb..419efc441 100644 --- a/apps/renderer/src/modules/trending/index.tsx +++ b/apps/renderer/src/modules/trending/index.tsx @@ -1,5 +1,5 @@ import type { User } from "@auth/core/types" -import { isMobile } from "@follow/components/hooks/useMobile.js" +import { isMobile, useMobile } from "@follow/components/hooks/useMobile.js" import { PhUsersBold } from "@follow/components/icons/users.jsx" import { Avatar, AvatarFallback, AvatarImage } from "@follow/components/ui/avatar/index.jsx" import { ActionButton, Button } from "@follow/components/ui/button/index.js" @@ -33,7 +33,12 @@ export const TrendingButton = ({ language, className }: TrendingProps & { classN variant={"outline"} onClick={() => { present({ - title: t("words.trending"), + title: ( +
+ + {t("words.trending")} +
+ ), content: () => , CustomModalComponent: !isMobile() ? DrawerModalLayout : undefined, }) @@ -46,6 +51,8 @@ export const TrendingButton = ({ language, className }: TrendingProps & { classN ) } const TrendContent: FC = ({ language }) => { + const isMobile = useMobile() + const { data } = useQuery({ queryKey: ["trending", language], queryFn: () => { @@ -57,7 +64,7 @@ const TrendContent: FC = ({ language }) => { const { dismiss } = useCurrentModal() if (!data) return ( -
+
} size="large" @@ -66,10 +73,12 @@ const TrendContent: FC = ({ language }) => { ) return (
-
- - {t("words.trending")} -
+ {!isMobile && ( +
+ + {t("words.trending")} +
+ )} = ({ language }) => { diff --git a/apps/renderer/src/modules/wallet/hooks.ts b/apps/renderer/src/modules/wallet/hooks.ts index 66d764324..e8d5f1af9 100644 --- a/apps/renderer/src/modules/wallet/hooks.ts +++ b/apps/renderer/src/modules/wallet/hooks.ts @@ -10,7 +10,15 @@ export const useTipModal = () => { const { present } = useModalStack() const { t } = useTranslation() return useCallback( - ({ userId, feedId, entryId }: { userId?: string; feedId?: string; entryId?: string }) => { + ({ + userId, + feedId, + entryId, + }: { + userId?: string | null + feedId?: string + entryId?: string + }) => { if (!feedId || !entryId) { // this should not happen unless there is a bug in the code toast.error("Invalid feed id or entry id") diff --git a/apps/renderer/src/modules/wallet/tip-modal.tsx b/apps/renderer/src/modules/wallet/tip-modal.tsx index e93a1abb3..570417850 100644 --- a/apps/renderer/src/modules/wallet/tip-modal.tsx +++ b/apps/renderer/src/modules/wallet/tip-modal.tsx @@ -31,7 +31,7 @@ const Loading = () => ( ) export const TipModalContent: FC<{ - userId?: string + userId?: string | null feedId: string entryId: string }> = (props) => { @@ -43,7 +43,7 @@ export const TipModalContent: FC<{ return } const TipModalContent_: FC<{ - userId?: string + userId?: string | null feedId: string entryId: string }> = ({ userId, feedId, entryId }) => { diff --git a/apps/renderer/src/providers/lazy/index.rn.ts b/apps/renderer/src/providers/lazy/index.rn.ts new file mode 100644 index 000000000..83f3297b9 --- /dev/null +++ b/apps/renderer/src/providers/lazy/index.rn.ts @@ -0,0 +1,9 @@ +export { ContextMenuProvider as LazyContextMenuProvider } from "../context-menu-provider" +export { ExtensionExposeProvider as LazyExtensionExposeProvider } from "../extension-expose-provider" +export { LottieRenderContainer as LazyLottieRenderContainer } from "~/components/ui/lottie-container" +export { ModalStackProvider as LazyModalStackProvider } from "~/components/ui/modal" + +const noop = () => null +export const LazyReloadPrompt = noop +export const LazyPWAPrompt = noop +export const LazyExternalJumpInProvider = noop diff --git a/apps/renderer/src/providers/root-providers.tsx b/apps/renderer/src/providers/root-providers.tsx index e7bbf5c1b..102b7091b 100644 --- a/apps/renderer/src/providers/root-providers.tsx +++ b/apps/renderer/src/providers/root-providers.tsx @@ -57,7 +57,7 @@ export const RootProviders: FC = ({ children }) => ( - + {!window.__RN__ && } diff --git a/apps/renderer/src/router.tsx b/apps/renderer/src/router.tsx index 30d8d8267..64e29c0f8 100644 --- a/apps/renderer/src/router.tsx +++ b/apps/renderer/src/router.tsx @@ -11,7 +11,9 @@ const globTree = import.meta.glob("./pages/**/*.tsx") const tree = buildGlobRoutes(globTree) let routerCreator = - IN_ELECTRON || globalThis["__DEBUG_PROXY__"] ? createHashRouter : createBrowserRouter + IN_ELECTRON || window.__RN__ || globalThis["__DEBUG_PROXY__"] + ? createHashRouter + : createBrowserRouter if (window.SENTRY_RELEASE) { routerCreator = wrapCreateBrowserRouter(routerCreator) } diff --git a/apps/renderer/src/store/feed/store.ts b/apps/renderer/src/store/feed/store.ts index 6b2802927..eeac40987 100644 --- a/apps/renderer/src/store/feed/store.ts +++ b/apps/renderer/src/store/feed/store.ts @@ -15,7 +15,7 @@ import { FeedService } from "~/services" import { getSubscriptionByFeedId } from "../subscription" import { userActions } from "../user" -import { createImmerSetter, createZustandStore } from "../utils/helper" +import { createImmerSetter, createTransaction, createZustandStore } from "../utils/helper" import type { FeedQueryParams, FeedState } from "./types" export const useFeedStore = createZustandStore("feed")(() => ({ @@ -31,47 +31,52 @@ class FeedActions { set({ feeds: {} }) } - upsertMany(feeds: FeedModel[]) { - runTransactionInScope(() => { + async upsertMany(feeds: FeedModel[]) { + const tx = createTransaction() + + tx.optimistic(() => { + immerSet((state) => { + for (const feed of feeds) { + if (feed.errorAt && new Date(feed.errorAt).getTime() > Date.now() - distanceTime) { + feed.errorAt = null + } + if (feed.id) { + if (feed.owner) { + userActions.upsert(feed.owner as UserModel) + } + if (feed.tipUsers) { + userActions.upsert(feed.tipUsers) + } + + // Not all API return these fields, so merging is needed here. + const targetFeed = state.feeds[feed.id] + + if (targetFeed?.owner) { + feed.owner = { ...targetFeed.owner } + } + if ( + targetFeed && + "tipUsers" in targetFeed && + targetFeed.tipUsers && + // Workaround for type issue + Array.isArray(targetFeed.tipUsers) + ) { + feed.tipUsers = [...targetFeed.tipUsers] + } + + state.feeds[feed.id] = omit(feed, "feeds") as FeedModel + } else { + // Store temp feed in memory + const nonce = feed["nonce"] || nanoid(8) + state.feeds[nonce] = { ...feed, id: nonce } + } + } + }) + }) + tx.persist(() => { FeedService.upsertMany(feeds) }) - immerSet((state) => { - for (const feed of feeds) { - if (feed.errorAt && new Date(feed.errorAt).getTime() > Date.now() - distanceTime) { - feed.errorAt = null - } - if (feed.id) { - if (feed.owner) { - userActions.upsert(feed.owner as UserModel) - } - if (feed.tipUsers) { - userActions.upsert(feed.tipUsers) - } - - // Not all API return these fields, so merging is needed here. - const targetFeed = state.feeds[feed.id] - - if (targetFeed?.owner) { - feed.owner = { ...targetFeed.owner } - } - if ( - targetFeed && - "tipUsers" in targetFeed && - targetFeed.tipUsers && - // Workaround for type issue - Array.isArray(targetFeed.tipUsers) - ) { - feed.tipUsers = [...targetFeed.tipUsers] - } - - state.feeds[feed.id] = omit(feed, "feeds") as FeedModel - } else { - // Store temp feed in memory - const nonce = feed["nonce"] || nanoid(8) - state.feeds[nonce] = { ...feed, id: nonce } - } - } - }) + await tx.run() } private patch(feedId: string, patch: Partial) { diff --git a/apps/renderer/src/store/utils/helper.ts b/apps/renderer/src/store/utils/helper.ts index e1762bc88..87bf50ee0 100644 --- a/apps/renderer/src/store/utils/helper.ts +++ b/apps/renderer/src/store/utils/helper.ts @@ -172,7 +172,12 @@ class Transaction { } if (this.onPersist) { - await runTransactionInScope(() => Promise.resolve(this.onPersist!(this._snapshot, this._ctx))) + await runTransactionInScope(() => + Promise.resolve(this.onPersist!(this._snapshot, this._ctx)).catch((err) => { + console.error(err) + throw err + }), + ) } } } diff --git a/apps/renderer/src/styles/additional.css b/apps/renderer/src/styles/additional.css index 298813053..f4e3087d1 100644 --- a/apps/renderer/src/styles/additional.css +++ b/apps/renderer/src/styles/additional.css @@ -57,7 +57,7 @@ } #root [data-button="true"][data-action="true"] { - @apply bg-transparent font-bold font-sans text-foreground relative -mr-[16px] px-4 before:absolute before:inset-y-0 before:left-0 before:w-px before:bg-foreground/30; + @apply relative -mr-[16px] bg-transparent px-4 font-sans font-bold text-foreground before:absolute before:inset-y-0 before:left-0 before:w-px before:bg-foreground/30; } } @@ -69,7 +69,7 @@ content: ""; border-radius: var(--border-radius); - @apply absolute inset-0 pointer-events-none z-[-1] dark:opacity-20 opacity-10 !transform-none; + @apply pointer-events-none absolute inset-0 z-[-1] !transform-none opacity-10 dark:opacity-20; } &[data-type="success"]::before { diff --git a/apps/renderer/src/styles/base.css b/apps/renderer/src/styles/base.css index be9fb6c69..f732909e0 100644 --- a/apps/renderer/src/styles/base.css +++ b/apps/renderer/src/styles/base.css @@ -28,7 +28,7 @@ body, @apply font-theme; - @apply print:overflow-auto print:h-auto; + @apply print:h-auto print:overflow-auto; } :focus-visible { @@ -53,5 +53,5 @@ button { } #react-scan-toolbar { - @apply max-lg:!hidden no-drag-region; + @apply no-drag-region max-lg:!hidden; } diff --git a/apps/renderer/src/workers/sw/index.ts b/apps/renderer/src/workers/sw/index.ts index 9e0503975..5fe34af11 100644 --- a/apps/renderer/src/workers/sw/index.ts +++ b/apps/renderer/src/workers/sw/index.ts @@ -26,8 +26,8 @@ registerRoute( statuses: [0, 200], }), new ExpirationPlugin({ - maxEntries: 300, - maxAgeSeconds: 30 * 24 * 60 * 60, + maxEntries: 100, + maxAgeSeconds: 10 * 24 * 60 * 60, purgeOnQuotaError: true, }), ], diff --git a/apps/server/client/modules/login/index.tsx b/apps/server/client/modules/login/index.tsx index 11a1b7d09..3f22cce04 100644 --- a/apps/server/client/modules/login/index.tsx +++ b/apps/server/client/modules/login/index.tsx @@ -51,7 +51,7 @@ export function Login() { useEffect(() => { if (provider && !isCredentialProvider && status === "unauthenticated") { - loginHandler(provider) + loginHandler(provider, "app") setRedirecting(true) } }, [isCredentialProvider, provider, status]) @@ -135,11 +135,13 @@ export function Login() { authProvidersConfig[key]?.buttonClassName, )} onClick={() => { - loginHandler(key) + loginHandler(key, "app") }} > {" "} - {t("login.continueWith", { provider: provider.name })} + {t("login.continueWith", { + provider: provider.name, + })} ))}
@@ -162,7 +164,7 @@ export function Login() { { - loginHandler(key) + loginHandler(key, "app") }} > {overrideProviderIconMap[provider.id] ? ( @@ -226,7 +228,7 @@ const formSchema = z.object({ }) async function onSubmit(values: z.infer) { - const res = await loginHandler("credential", "browser", values) + const res = await loginHandler("credential", "app", values) if (res?.error) { toast.error(res.error.message) return @@ -284,7 +286,7 @@ function LoginWithPassword() { buttonClassName="text-base !mt-3" disabled={!isValid} > - {t("login.continueWith", { provider: "email" })} + {t("login.continueWith", { provider: t("words.email") })}