Skip to content

Commit

Permalink
wip: cleanups (#1005)
Browse files Browse the repository at this point in the history
* fix: status bar

* update Timeline.tsx

* update AppLoading.tsx, StatusBar.tsx, Timeline.tsx and apps/mobile/src/hooks/index.ts

* update apps/mobile/src/hooks/index.ts

* update TimelineFilters.tsx

* chore: bump deps (#1002)

* build: update package.json

* update 8 files

* update 5 files

* fix: og generation (#1003)

* fix: og generation

* build(deps): update yarn.lock

* update ThumbnailImage.tsx and BytesSection.tsx

* fix: thumbnail (#1004)

* delete 3 files and update 7 files

* update TabList.tsx

* feat: manage

* update ManagersModal.tsx, Managed.tsx, Managers.tsx and Accordion.tsx

* fix: home loader

* update Info.tsx

* update Managers.tsx

* feat: add 404

* update Managers.tsx

* update Streak.tsx

* update Streak.tsx and theme.ts

* update Streak.tsx

* update Streak.tsx

* update Streak.tsx

* update 13 files

* fix: refetch loader

* update Info.tsx
  • Loading branch information
sasicodes committed Sep 7, 2023
1 parent be14a09 commit 7cd0ff3
Show file tree
Hide file tree
Showing 40 changed files with 876 additions and 329 deletions.
5 changes: 3 additions & 2 deletions apps/api/pages/api/metatags.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getMetaTags } from '@lenstube/browser'
import { LENSTUBE_APP_DESCRIPTION, OG_IMAGE } from '@lenstube/constants'
import { trimLensHandle } from '@lenstube/generic'
import getProfileMeta from 'lib/getProfileMeta'
import getPublicationMeta from 'lib/getPublicationMeta'
import type { NextApiRequest, NextApiResponse } from 'next'
Expand All @@ -21,8 +22,8 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {

try {
if (isChannel) {
const handle = path.replace('/channel/', '').replace('.lens', '')
return await getProfileMeta(res, `${handle}.lens`)
const handle = path.replace('/channel/', '')
return await getProfileMeta(res, trimLensHandle(handle, true))
}

if (isVideo || isByte) {
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/components/common/AppLoading.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Image as ExpoImage } from 'expo-image'
import * as SplashScreen from 'expo-splash-screen'
import type { FC, PropsWithChildren } from 'react'
import React, { useState } from 'react'
import React, { useEffect, useState } from 'react'
import { useWindowDimensions } from 'react-native'

import { useMobilePersistStore } from '~/store/persist'

import { useAuth, useCachedResources, useEffect } from '../../hooks'
import { useAuth, useCachedResources } from '../../hooks'

SplashScreen.preventAutoHideAsync()

Expand Down
183 changes: 0 additions & 183 deletions apps/mobile/src/components/common/Header.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from 'react'
import haptic from '~/helpers/haptic'
import { useMobileTheme } from '~/hooks'

import AnimatedPressable from '../ui/AnimatedPressable'
import AnimatedPressable from '../../ui/AnimatedPressable'

const BackButton = () => {
const { themeConfig } = useMobileTheme()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from 'react'
import haptic from '~/helpers/haptic'
import { useMobileTheme } from '~/hooks'

import AnimatedPressable from '../ui/AnimatedPressable'
import AnimatedPressable from '../../ui/AnimatedPressable'

const CollapseButton = () => {
const { themeConfig } = useMobileTheme()
Expand Down
108 changes: 108 additions & 0 deletions apps/mobile/src/components/common/header/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import Ionicons from '@expo/vector-icons/Ionicons'
import { type BottomSheetModal } from '@gorhom/bottom-sheet'
import type { MobileThemeConfig } from '@lenstube/lens/custom-types'
import type { HeaderTitleProps } from '@react-navigation/elements'
import { useNavigation } from '@react-navigation/native'
import type { FC } from 'react'
import React, { useRef } from 'react'
import { StyleSheet, Text, View } from 'react-native'

import haptic from '~/helpers/haptic'
import normalizeFont from '~/helpers/normalize-font'
import { useMobileTheme } from '~/hooks'
import useMobileStore from '~/store'

import AnimatedPressable from '../../ui/AnimatedPressable'
import SignIn from '../auth/SignIn'
import UserProfile from '../UserProfile'
import MenuSheet from './MenuSheet'

const styles = (themeConfig: MobileThemeConfig) =>
StyleSheet.create({
container: {
flexDirection: 'row',
width: '100%',
justifyContent: 'space-between',
alignItems: 'center',
paddingBottom: 10
},
rightView: {
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
gap: 20
},
forYouText: {
color: themeConfig.textColor,
fontFamily: 'font-bold',
fontWeight: '500',
fontSize: normalizeFont(22)
},
newButton: {
width: 30,
height: 30,
borderRadius: 100,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
backgroundColor: themeConfig.backgroudColor
}
})

const AuthenticatedUser = () => {
const profileMenuRef = useRef<BottomSheetModal>(null)
const selectedChannel = useMobileStore((state) => state.selectedChannel)

if (!selectedChannel) {
return null
}

return (
<>
<UserProfile
profile={selectedChannel}
showHandle={false}
size={30}
onPress={() => {
haptic()
profileMenuRef.current?.present()
}}
/>
<MenuSheet profileMenuRef={profileMenuRef} />
</>
)
}

const Header: FC<HeaderTitleProps> = () => {
const { themeConfig } = useMobileTheme()
const style = styles(themeConfig)
const { navigate } = useNavigation()

const selectedChannel = useMobileStore((state) => state.selectedChannel)

return (
<View style={style.container}>
<Text style={style.forYouText}>gm</Text>

<View style={style.rightView}>
{selectedChannel && (
<AnimatedPressable
style={style.newButton}
onPress={() => navigate('NewPublication')}
>
<Ionicons
name="add-outline"
color={themeConfig.textColor}
style={{ paddingLeft: 1 }}
size={20}
/>
</AnimatedPressable>
)}

{selectedChannel ? <AuthenticatedUser /> : <SignIn />}
</View>
</View>
)
}

export default Header
Loading

3 comments on commit 7cd0ff3

@vercel
Copy link

@vercel vercel bot commented on 7cd0ff3 Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web – ./apps/web

web-git-main-lenstube.vercel.app
web-lenstube.vercel.app
lenstube.xyz
www.lenstube.xyz

@vercel
Copy link

@vercel vercel bot commented on 7cd0ff3 Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

embed – ./apps/embed

embed-git-main-lenstube.vercel.app
embed-lenstube.vercel.app
embed.lenstube.xyz

@vercel
Copy link

@vercel vercel bot commented on 7cd0ff3 Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

api – ./apps/api

api-git-main-lenstube.vercel.app
api-lenstube.vercel.app
api.lenstube.xyz

Please sign in to comment.