Full stack Software Engineer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const VISA_REQUIREMENTS = { | |
| austria: "", | |
| belgium: "", | |
| "czech republic": "", | |
| denmark: | |
| "https://storbritannien.um.dk/en/travel-and-residence/how-to-apply-for-a-visa/visa-checklists", | |
| estonia: "", | |
| finland: "", | |
| france: "", | |
| germany: "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState, useEffect } from "react"; | |
| import axios from "axios"; | |
| const App = () => { | |
| const [username, setUsername] = useState(""); | |
| const [password, setPassword] = useState(""); | |
| const [user, setUser] = useState(); | |
| useEffect(() => { | |
| const loggedInUser = localStorage.getItem("user"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState, useEffect } from "react"; | |
| import Posts from "./Posts"; | |
| import posts from "./postsArray"; | |
| const postsPerPage = 3; | |
| let arrayForHoldingPosts = []; | |
| const App = () => { | |
| const [postsToShow, setPostsToShow] = useState([]); | |
| const [next, setNext] = useState(3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // pages/login.js | |
| import { useCookies } from "react-cookie" | |
| const Login = () => { | |
| const [cookie, setCookie] = useCookies(["user"]) | |
| const handleSignIn = async () => { | |
| try { | |
| const response = await yourLoginFunction(username) //handle API call to sign in here. | |
| const data = response.data | |
| setCookie("user", JSON.stringify(data), { | |
| path: "/", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Footer from '../../components/Footer'; | |
| import axios from 'axios'; | |
| import parse from 'html-react-parser'; | |
| import { getAuthor, getFeaturedImage } from '../../lib/utils'; | |
| import { POSTS_API_URL } from '../../lib/constants'; | |
| import Head from 'next/head'; | |
| import styles from '../../styles/Post.module.css'; | |
| export default function Post({ title, featuredImg, author, content, date }) { | |
| return ( | |
| <div className="flex flex-col items-center justify-center min-h-screen"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Footer from '../../components/Footer'; | |
| import axios from 'axios'; | |
| import { getAuthor, getFeaturedImage } from '../../lib/utils'; | |
| import { POSTS_API_URL } from '../../lib/constants'; | |
| export default function Post({ title, featuredImg, author, content, date }) { | |
| return ( | |
| <div className="flex flex-col items-center justify-center min-h-screen"> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Link from 'next/link'; | |
| import { useState, useEffect } from 'react'; | |
| import { getAuthor, getFeaturedImage } from '../lib/utils'; | |
| import parse from 'html-react-parser'; | |
| export default function Post({ post }) { | |
| const [postImgAndAuthor, setPostImgAndAuthor] = useState({ featImgUrl: '', author: '' }); | |
| useEffect(() => { | |
| let mounted = true; | |
| if (mounted) { | |
| const author = getAuthor(post.author); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Head from 'next/head'; | |
| import Post from '../components/Post'; | |
| import Footer from '../components/Footer'; | |
| import { useState, useEffect } from 'react'; | |
| import { getAllPostsFromServer } from '../lib/utils'; | |
| export default function Home() { | |
| const [posts, setPosts] = useState([]); | |
| useEffect(async () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import axios from 'axios'; | |
| import { POSTS_API_URL, AUTHORS_API_URL, MEDIA_API_URL } from './constants'; | |
| export const getAllPostsFromServer = async () => { | |
| // get all posts from Server | |
| try { | |
| const { data } = await axios.get(POSTS_API_URL); | |
| return data; | |
| } catch (error) { |
NewerOlder