Skip to content
Merged
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
74 changes: 70 additions & 4 deletions app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,72 @@
import "@/global.css";
import { tabs } from "@/constants/data";
import clsx from "clsx";
import { Tabs } from "expo-router";
import { Image, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";

export default function RootLayout() {
return <Tabs screenOptions={{ headerShown: false }} />;
}
import { COLORS, COMPONENTS } from "@/constants/theme";

const tabBar = COMPONENTS.tabBar;

const TabIcon = ({ focused, icon }: TabIconProps) => {
return (
<View className="tabs-icon">
<View className={clsx("tabs-pill", focused && "tabs-active")}>
<Image source={icon} resizeMode="contain" className="tabs-glyph" />
</View>
</View>
);
};

const TabsLayout = () => {
const insets = useSafeAreaInsets();

return (
<Tabs
screenOptions={{
headerShown: false,
tabBarShowLabel: false,
tabBarStyle: {
position: "absolute",
bottom: Math.max(insets.bottom, tabBar.horizontalInset),
height: tabBar.height,
marginHorizontal: tabBar.horizontalInset,
borderRadius: tabBar.radius,
backgroundColor: COLORS.primary,
borderTopWidth: 0,
elevation: 0,
},
tabBarItemStyle: {
paddingVertical: tabBar.height / 2 - tabBar.iconFrame / 1.6,
},
tabBarIconStyle: {
width: tabBar.iconFrame,
height: tabBar.iconFrame,
alignItems: "center",
},
}}
>
{tabs.map((item) => (
<Tabs.Screen
key={item.name}
name={item.name}
options={{
title: item.title,
tabBarIcon: ({ focused }) => (
<TabIcon focused={focused} icon={item.icon} />
),
}}
/>
))}

<Tabs.Screen
name="subscriptions/[id]"
options={{
href: null,
}}
/>
Comment thread
devcedrick marked this conversation as resolved.
Comment thread
devcedrick marked this conversation as resolved.
</Tabs>
);
};

export default TabsLayout;
12 changes: 8 additions & 4 deletions app/(tabs)/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import "@/global.css";
import { Link } from "expo-router";
import { Text, View } from "react-native";
import { styled } from "nativewind";
import { Text } from "react-native";
import { SafeAreaView as RNSafeAreaView } from "react-native-safe-area-context";

const SafeAreaView = styled(RNSafeAreaView);

export default function App() {
return (
<View className="flex-1 items-center justify-center bg-background">
<SafeAreaView className="flex-1 bg-background p-5">
<Text className="text-xl font-bold text-success">
Welcome to Nativewind!
</Text>
Expand All @@ -23,11 +27,11 @@ export default function App() {

{/* Subscription Examples */}
<Link
href="/subscriptions/claude-ai"
href={{ pathname: "/subscriptions/[id]", params: { id: "claude-ai" } }}
className="bg-accent text-white text-xl p-3 rounded-md m-5"
>
Claude Max Subscription
</Link>
</View>
</SafeAreaView>
);
}
10 changes: 7 additions & 3 deletions app/(tabs)/insights.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { styled } from "nativewind";
import React from "react";
import { Text, View } from "react-native";
import { Text } from "react-native";
import { SafeAreaView as RNSafeAreaView } from "react-native-safe-area-context";

const SafeAreaView = styled(RNSafeAreaView);

const Insights = () => {
return (
<View>
<SafeAreaView>
Comment thread
devcedrick marked this conversation as resolved.
<Text>Insights</Text>
</View>
</SafeAreaView>
);
};

Expand Down
10 changes: 7 additions & 3 deletions app/(tabs)/settings.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { styled } from "nativewind";
import React from "react";
import { Text, View } from "react-native";
import { Text } from "react-native";
import { SafeAreaView as RNSafeAreaView } from "react-native-safe-area-context";

const SafeAreaView = styled(RNSafeAreaView);

const Settings = () => {
return (
<View>
<SafeAreaView>
Comment thread
devcedrick marked this conversation as resolved.
<Text>Settings</Text>
</View>
</SafeAreaView>
);
};

Expand Down
10 changes: 7 additions & 3 deletions app/(tabs)/subscriptions.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { styled } from "nativewind";
import React from "react";
import { Text, View } from "react-native";
import { Text } from "react-native";
import { SafeAreaView as RNSafeAreaView } from "react-native-safe-area-context";

const SafeAreaView = styled(RNSafeAreaView);

const Subscriptions = () => {
return (
<View>
<SafeAreaView>
Comment thread
devcedrick marked this conversation as resolved.
<Text>Subscriptions</Text>
</View>
</SafeAreaView>
);
};

Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions assets/expo.icon/Assets/expo-symbol 2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/expo.icon/Assets/grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions assets/expo.icon/icon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"fill" : {
"automatic-gradient" : "extended-srgb:0.00000,0.47843,1.00000,1.00000"
},
"groups" : [
{
"layers" : [
{
"image-name" : "expo-symbol 2.svg",
"name" : "expo-symbol 2",
"position" : {
"scale" : 1,
"translation-in-points" : [
1.1008400065293245e-05,
-16.046875
]
}
},
{
"image-name" : "grid.png",
"name" : "grid"
}
],
"shadow" : {
"kind" : "neutral",
"opacity" : 0.5
},
"translucency" : {
"enabled" : true,
"value" : 0.5
}
}
],
"supported-platforms" : {
"circles" : [
"watchOS"
],
"squares" : "shared"
}
}
Binary file added assets/fonts/PlusJakartaSans-Bold.ttf
Binary file not shown.
Binary file added assets/fonts/PlusJakartaSans-ExtraBold.ttf
Binary file not shown.
Binary file added assets/fonts/PlusJakartaSans-Light.ttf
Binary file not shown.
Binary file added assets/fonts/PlusJakartaSans-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/PlusJakartaSans-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/PlusJakartaSans-SemiBold.ttf
Binary file not shown.
Binary file added assets/icons/activity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/adobe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/canva.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/claude.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/dropbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/figma.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/netflix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/notion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/openai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/setting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/spotify.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/wallet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/expo-badge-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/expo-badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/expo-logo.png
Binary file modified assets/images/icon.png
Binary file added assets/images/logo-glow.png
Binary file removed assets/images/partial-react-logo.png
Diff not rendered.
Binary file modified assets/images/splash-icon.png
Binary file added assets/images/splash-pattern.png
Binary file added assets/images/tabIcons/explore.png
Binary file added assets/images/tabIcons/explore@2x.png
Binary file added assets/images/tabIcons/explore@3x.png
Binary file added assets/images/tabIcons/home.png
Binary file added assets/images/tabIcons/home@2x.png
Binary file added assets/images/tabIcons/home@3x.png
Binary file added assets/images/tutorial-web.png
8 changes: 8 additions & 0 deletions constants/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import icons from "./icons";

export const tabs = [
{ name: "index", title: "Home", icon: icons.home },
{ name: "subscriptions", title: "Subscriptions", icon: icons.wallet },
{ name: "insights", title: "Insights", icon: icons.activity },
{ name: "settings", title: "Settings", icon: icons.setting },
];
66 changes: 66 additions & 0 deletions constants/icons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import activity from "@/assets/icons/activity.png";
import add from "@/assets/icons/add.png";
import adobe from "@/assets/icons/adobe.png";
import back from "@/assets/icons/back.png";
import canva from "@/assets/icons/canva.png";
import claude from "@/assets/icons/claude.png";
import dropbox from "@/assets/icons/dropbox.png";
import figma from "@/assets/icons/figma.png";
import github from "@/assets/icons/github.png";
import home from "@/assets/icons/home.png";
import logo from "@/assets/icons/logo.png";
import medium from "@/assets/icons/medium.png";
import menu from "@/assets/icons/menu.png";
import netflix from "@/assets/icons/netflix.png";
import notion from "@/assets/icons/notion.png";
import openai from "@/assets/icons/openai.png";
import plus from "@/assets/icons/plus.png";
import setting from "@/assets/icons/setting.png";
import spotify from "@/assets/icons/spotify.png";
import wallet from "@/assets/icons/wallet.png";

export {
activity,
add,
adobe,
back,
canva,
claude,
dropbox,
figma,
github,
home,
logo,
medium,
menu,
netflix,
notion,
openai,
plus,
setting,
spotify,
wallet
};
Comment on lines +22 to +43

export default {
activity,
add,
adobe,
back,
canva,
claude,
dropbox,
figma,
github,
home,
logo,
medium,
menu,
netflix,
notion,
openai,
plus,
setting,
spotify,
wallet,
};
52 changes: 52 additions & 0 deletions constants/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

export const COLORS = {
background: "#fff9e3",
foreground: "#081126",
card: "#fff8e7",
muted: "#f6eecf",
mutedForeground: "rgba(0, 0, 0, 0.6)",
primary: "#081126",
accent: "#ea7a53",
border: "rgba(0, 0, 0, 0.1)",
success: "#16a34a",
destructive: "#dc2626",
subscription: "#8fd1bd",
} as const;

export const SPACING = {
0: 0,
1: 4,
2: 8,
3: 12,
4: 16,
5: 20,
6: 24,
7: 28,
8: 32,
9: 36,
10: 40,
11: 44,
12: 48,
14: 56,
16: 64,
18: 72,
20: 80,
24: 96,
30: 120,
} as const;

export const COMPONENTS = {
tabBar: {
height: SPACING[18],
horizontalInset: SPACING[5],
radius: SPACING[8],
iconFrame: SPACING[12],
itemPaddingVertical: SPACING[2],
},
} as const;

export const theme = {
colors: COLORS,
spacing: SPACING,
components: COMPONENTS,
} as const;
24 changes: 24 additions & 0 deletions image.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
declare module "*.png" {
const value: any;
export default value;
}

declare module "*.jpg" {
const value: any;
export default value;
}

declare module "*.jpeg" {
const value: any;
export default value;
}

declare module "*.gif" {
const value: any;
export default value;
}

declare module "*.svg" {
const value: any;
export default value;
}
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@react-navigation/bottom-tabs": "^7.4.0",
"@react-navigation/elements": "^2.6.3",
"@react-navigation/native": "^7.1.8",
"clsx": "^2.1.1",
"expo": "~54.0.34",
"expo-constants": "~18.0.13",
"expo-font": "~14.0.11",
Expand Down
Loading