Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 1 addition & 97 deletions packages/app/components/Banner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,101 +75,5 @@ export const FlatlistBanner = () => {

//

return (
<View
style={{
maxWidth: 500,
marginHorizontal: ITEM_PADDING,
width: ITEM_WIDTH,
height: HEIGHT / 4,
margin: ITEM_PADDING
}}
>
{isSuccess ? (
<View>
<SwiperFlatList
ref={flatListRef}
autoplay
autoplayDelay={25}
autoplayLoop
data={isSuccess ? list : []}
renderItem={(props) => <Item {...props} />}
showPagination
initialNumToRender={1}
PaginationComponent={CustomPagination}
/>
{/*Floating Btn*/}
<Pressable
style={{
position: "absolute",
left: 0,
top: "50%",
transform: [{ translateY: -18 }]
}}
onPress={() => {
const curId = flatListRef.current?.getCurrentIndex();
if (curId !== undefined && curId > 0)
flatListRef.current?.scrollToIndex({ index: curId - 1 });
else flatListRef.current?.goToLastIndex();
}}
>
{({ isFocused, isHovered, isPressed }) => {
return (
<MaterialIcons
name="navigate-before"
size={36}
color="white"
style={{
opacity: isPressed ? 0.4 : isHovered ? 0.8 : 1,
borderRadius: 100,
backgroundColor: "#1499b1"
}}
/>
);
}}
</Pressable>

<Pressable
style={{
position: "absolute",
right: 0,
top: "50%",
transform: [{ translateY: -18 }]
}}
onPress={() => {
const curId = flatListRef.current?.getCurrentIndex();
if (curId !== undefined && curId < NUM_ITEM - 1)
flatListRef.current?.scrollToIndex({ index: curId + 1 });
else flatListRef.current?.goToFirstIndex();
}}
>
{({ isFocused, isHovered, isPressed }) => {
return (
<MaterialIcons
name="navigate-next"
size={36}
color="white"
style={{
opacity: isPressed ? 0.4 : isHovered ? 0.8 : 1,
borderRadius: 100,
backgroundColor: "#1499b1"
}}
/>
);
}}
</Pressable>
{/* Floating Btn */}
</View>
) : (
<Box bg={"$light.backgroundPrimary"}>
<Skeleton
w={ITEM_WIDTH}
h={ITEM_HEIGHT}
p={ITEM_PADDING / 4}
m="auto"
/>
</Box>
)}
</View>
);

};
43 changes: 1 addition & 42 deletions packages/app/components/ScaledImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,48 +215,7 @@ const ScaledImagex = ({
/>
);

return (
<>
<Image
progressiveRenderingEnabled={true}
source={{
uri: source.uri.replace(
"https://hahunavth-express-api.herokuapp.com/api/v1/cors/",
""
),
method: "GET",
headers: {
referer: "https://www.nettruyenpro.com"
}
}}
w={w}
h={ratio * w}
fadeDuration={0}
alt={source.uri}
// defaultSource={1}
/>
{/* <TFastImage
source={{
uri: source.uri.replace(
"https://hahunavth-express-api.herokuapp.com/api/v1/cors/",
""
),
method: "GET",
headers: {
referer: "https://www.nettruyenpro.com"
},
priority: TFastImage?.priority?.high,
cache: TFastImage?.cacheControl.web
}}
style={{ height: h, width: w }}
fadeDuration={0}
alt={"image"}
defaultSource={1}
resizeMode={TFastImage?.resizeMode?.cover}
// tintColor={"#9324c3"}
/> */}
</>
);

};

//make this component available to the app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,5 @@ export const FindByNameResultScreen = (props: FindByNameResultScreenProps) => {
<ComicListHeaderWrapper data={data?.data || []}></ComicListHeaderWrapper>
);

return (
<View flex={1}>
{/* <Text>{name}</Text> */}
{isLoading || loading ? (
<Loading text="Fetching" />
) : data?.data?.length ? (
<ComicVerticalList list={data?.data || []} />
) : (
<NotFound />
)}
</View>
);

};
37 changes: 2 additions & 35 deletions packages/app/screens/HomeScreen/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,7 @@ export const HomeScreen = () => {

// return <>{!loading && <HomeScreenContent />}</>;
return <HomeScreenContent />;
return (
<FadeInView>
{
// !loading ? (
// && !isNewOrientation
<HomeScreenContent />
// ) : (
// <Loading />
// )
}
</FadeInView>
);

};

const data = [
Expand Down Expand Up @@ -329,29 +318,7 @@ const HomeScreenContent = () => {
</ScrollView>
);

return (
<>
<FlatList
// bg={"warmGray.50"}
bg={"white"}
// @ts-ignore
// _dark={{ bg: "trueGray.900" }}
// TODO: WEB SPECIFIC STYLE
// @ts-ignore
data={data}
renderItem={renderItem}
keyExtractor={keyExtractor}
initialNumToRender={12}
// initialNumToRender={0} // cause low performance
maxToRenderPerBatch={2}
updateCellsBatchingPeriod={1000}
// decelerationRate="fast"
// removeClippedSubviews={true}
// disableVirtualization={true}
windowSize={12}
/>
</>
);

};

// end
Expand Down
43 changes: 1 addition & 42 deletions packages/app/screens/LoginScreen/LoginScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,48 +249,7 @@ export const LoginScreen = () => {
</VStack>
);

return (
<View style={styles.container}>
{showUserInfo()}
{isLogin ? (
<Button onPress={() => dispatch(authActions.logout(null))}>
Logout
</Button>
) : (
<VStack space={2}>
<Button
onPress={handlePressAsync}
disabled={!freq}
colorScheme={"blue"}
w={220}
>
<HStack space={2}>
<Entypo name="facebook" size={24} color="white" />
<Text color={"white"}>Login with Facebook</Text>
</HStack>
</Button>
<Button
// @ts-ignore
onPress={
accessToken
? getUserData
: () => {
promptAsync({ useProxy: false, showInRecents: true });
}
}
w={220}
colorScheme={"red"}
>
{/* {accessToken ? "Get User Data" : "Login with Google"} */}
<HStack space={2}>
<AntDesign name="google" size={24} color="white" />
<Text color={"white"}>Login with Facebook</Text>
</HStack>
</Button>
</VStack>
)}
</View>
);

};

const styles = StyleSheet.create({
Expand Down
120 changes: 1 addition & 119 deletions packages/next/src/components/Carousel/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -472,123 +472,5 @@ export const Carousel = (props: Props) => {
</HStack>
);

return (
<div
style={{
width: 1000,
height: 500
// flex: 1
}}
>
<div className="carousel">
<div className="carousel__nav">
<span id="moveLeft" className="carousel__arrow">
<svg
className="carousel__icon"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path d="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"></path>
</svg>
</span>
<span id="moveRight" className="carousel__arrow">
<svg
className="carousel__icon"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path d="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"></path>
</svg>
</span>
</div>
<div className="carousel-item carousel-item--1">
<div className="carousel-item__image"></div>
<div className="carousel-item__info">
<div className="carousel-item__container">
<h2 className="carousel-item__subtitle">The grand moment </h2>
<h1 className="carousel-item__title">Le tour</h1>
<p className="carousel-item__description">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem
accusantium doloremque laudantium, totam rem aperiam.
</p>
<a href="#" className="carousel-item__btn">
Explore the tour
</a>
</div>
</div>
</div>
<div className="carousel-item carousel-item--2">
<div className="carousel-item__image"></div>
<div className="carousel-item__info">
<div
className="carousel-item__container"
style={{ backgroundColor: "red" }}
>
<h2 className="carousel-item__subtitle">The big window </h2>
<h1 className="carousel-item__title">Minimal window</h1>
<p className="carousel-item__description">
Clear Glass Window With Brown and White Wooden Frame iste natus
error sit voluptatem accusantium doloremque laudantium.
</p>
<a href="#" className="carousel-item__btn">
Read the article
</a>
</div>
</div>
</div>
<div className="carousel-item carousel-item--3">
<div className="carousel-item__image"></div>
<div className="carousel-item__info">
<div className="carousel-item__container">
<h2 className="carousel-item__subtitle">Tropical palms </h2>
<h1 className="carousel-item__title">Palms</h1>
<p className="carousel-item__description">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem
accusantium doloremque laudantium, totam rem aperiam.
</p>
<a href="#" className="carousel-item__btn">
Explore the palms
</a>
</div>
</div>
</div>

<div className="carousel-item carousel-item--4">
<div className="carousel-item__image"></div>
<div className="carousel-item__info">
<div className="carousel-item__container">
<h2 className="carousel-item__subtitle">Beach </h2>
<h1 className="carousel-item__title">The beach </h1>
<p className="carousel-item__description">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem
accusantium doloremque laudantium, totam rem aperiam.
</p>
<a href="#" className="carousel-item__btn">
Explore the beach
</a>
</div>
</div>
</div>

<div className="carousel-item carousel-item--5">
<div className="carousel-item__image"></div>
<div className="carousel-item__info">
<div className="carousel-item__container">
<h2 className="carousel-item__subtitle">The white building </h2>
<h1 className="carousel-item__title">White building</h1>
<p className="carousel-item__description">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem
accusantium doloremque laudantium, totam rem aperiam.
</p>
<a href="#" className="carousel-item__btn">
Read the article
</a>
</div>
</div>
</div>
</div>
</div>
);

};
Loading