Skip to content

Instantly share code, notes, and snippets.

View alperbayram's full-sized avatar
🍊

Alper Bayram alperbayram

🍊
View GitHub Profile
//user/[id].tsx
import { View, Text, Image, TouchableOpacity } from "react-native";
import { useLocalSearchParams, router, usePathname } from "expo-router";
import { styles } from "../../styles/styles";
export default function Page() {
const pathname = usePathname();
const local = useLocalSearchParams();
return (
<View style={styles.container}>
//settings/index.tsx
import { View, Text } from "react-native";
import { Link } from "expo-router";
import { styles } from "../../styles/styles";
export default function Page() {
return (
<View style={styles.container}>
<Text style={styles.title}>settings</Text>
<View>
import { StyleSheet } from "react-native";
export const styles = StyleSheet.create({
container: {
marginVertical: 60,
flex: 1,
alignItems: "center",
justifyContent: "space-between",
},
screencontainer: {
@alperbayram
alperbayram / users.tsx
Last active December 15, 2023 08:41
users.tsx
//app/users.tsx
import { Text, View, Image } from "react-native";
import { Link } from "expo-router";
import { styles } from "../styles/styles";
export default function Page() {
const avatar1 = "https://avatars.githubusercontent.com/u/9664363?v=4";
const avatar2 = "https://avatars.githubusercontent.com/u/43719324?v=4";
return (
<View style={styles.container}>
//app/index.tsx
import { View, Text } from "react-native";
import { Link } from "expo-router";
import { styles } from "../styles/styles";
export default function Page() {
return (
<View style={styles.container}>
<Text style={styles.title}>index</Text>
<View>
@alperbayram
alperbayram / babel.config.js
Created December 12, 2023 21:31
babel.config.js
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: ['expo-router/babel'],
};
};
@alperbayram
alperbayram / app.json
Last active December 12, 2023 21:29
app.json
{
"scheme": "your-app-scheme",
"web": {
"bundler": "metro"
}
}
{
"main": "expo-router/entry"
}
@alperbayram
alperbayram / index.jsx
Created April 8, 2023 20:52
Bottom Bar
import React, { useState } from "react";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { Text, View, Dimensions, Image } from "react-native";
import Home from "../../screens/Home";
import Profile from "../../screens/Profile";
import ProfileSettings from "../../screens/Settings";
import { getPathDown } from "./curve";
import { Svg, Path } from "react-native-svg";
import { scale } from "react-native-size-scaling";
@alperbayram
alperbayram / curve.js
Created April 8, 2023 20:49
How to create center curved path in javascript
import * as shape from "d3-shape";
import { scale } from "react-native-size-scaling";
//** Path Line */
const line = (width, height) => {
const path = shape
.line()
.x((d) => d.x)
.y((d) => d.y)([
{ x: width / 2, y: 0 },