Skip to content

Instantly share code, notes, and snippets.

View YajanaRao's full-sized avatar
🎯
Focusing

Yajana N Rao YajanaRao

🎯
Focusing
View GitHub Profile
@YajanaRao
YajanaRao / scripts.js
Created February 11, 2022 15:10
For creating a user directory
let names = [];
let firstNameInput = document.getElementById("addFnameInput");
let addLnameInput = document.getElementById("addLnameInput");
let addItembtn = document.getElementById("addItembtn");
let deletSelected = document.getElementById("deletSelected");
function onPageLoad(){
names = JSON.parse(localStorage.getItem("localtask")) || [];
}
@YajanaRao
YajanaRao / service.js
Last active November 21, 2021 16:58
Includes functions related to api call
const baseUrl = "https://alpha.yajananrao.io";
export function register({ email, username, password, confirmPassword }) {
const data = {
username,
email,
"password1": password,
"password2": confirmPassword
};
return fetch(`${baseUrl}/auth/registration/`, {
@YajanaRao
YajanaRao / Login.js
Last active November 21, 2021 16:55
Login Screen for basic auth application
import * as React from 'react';
import { View } from 'react-native';
import { Button, Input, Card, Text } from 'react-native-elements';
import { useMutation } from 'react-query';
import { login } from '../service';
import styles from '../styles';
function LoginScreen({ navigation }) {
const [username, setUsername] = React.useState("");
@YajanaRao
YajanaRao / Register.js
Last active November 21, 2021 17:07
Register Screen for Basic Auth App
import * as React from 'react';
import { View } from 'react-native';
import { Button, Input, Card, Text } from 'react-native-elements';
import { useMutation } from 'react-query';
import { register } from '../service';
import styles from '../styles';
function RegisterScreen({ navigation }) {
const [email, setEmail] = React.useState("")
@YajanaRao
YajanaRao / App.js
Created November 21, 2021 16:13
App.js for Basic Auth setup
import * as React from 'react';
import { ThemeProvider } from 'react-native-elements';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { QueryClient, QueryClientProvider } from 'react-query'
import LoginScreen from './src/screens/Login';
import RegisterScreen from './src/screens/Register';
import HomeScreen from './src/screens/Home';
import DetailsScreen from './src/screens/Details';
@YajanaRao
YajanaRao / dependency.js
Created November 7, 2021 17:17
Dependency graph data
const response = {
"response": {
"534": {
"in": [],
"out": []
},
"535": {
"in": [],
"out": []
},
@YajanaRao
YajanaRao / machine.js
Created October 1, 2021 17:43
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@YajanaRao
YajanaRao / App.tsx
Created September 26, 2021 07:51
App.tsx file for Calendar app
// App.tsx
import * as React from 'react';
import {
Text,
View,
StyleSheet,
TextInput,
Button,
ScrollView,
StatusBar,
// src/components/Calendar/Calendar.tsx
import * as React from 'react';
import {
View,
Text,
Button,
TouchableOpacity,
StyleSheet,
} from 'react-native';
import { DefaultTheme } from '../../theme';
@YajanaRao
YajanaRao / utils.ts
Created September 26, 2021 07:47
Utils functions for calendar app
// src/components/Calender/utils
import { weekDays, daysInEachMonth } from './const';
export function generateMatrix(currentDate: Date) {
let matrix: (number | string)[][] = [];
// Create header of days
matrix[0] = weekDays;
let year = currentDate.getFullYear();