Moved old app into its component.

This commit is contained in:
moonstar-x 2023-06-02 12:36:27 -05:00
parent 7f0f856d19
commit a041941a70
3 changed files with 5 additions and 14 deletions

View File

@ -1,4 +1,4 @@
.App { .reddit-slideshow {
position: relative; position: relative;
background-color: black; background-color: black;
height: 100vh; height: 100vh;

View File

@ -1,8 +1,8 @@
import React, { Component } from "react"; import React, { Component } from "react";
import axios from "axios"; import axios from "axios";
import Layout from "../components/Layout/Layout"; import Layout from "../Layout/Layout";
import "./App.css"; import "./RedditSlideshow.css";
class App extends Component { class App extends Component {
state = { state = {
@ -409,9 +409,9 @@ class App extends Component {
render() { render() {
return ( return (
<div className="App"> <div className="reddit-slideshow">
<Layout <Layout
className="App" className="reddit-slideshow"
post={this.state.posts.length ? this.state.posts[this.state.currentPost] : null} post={this.state.posts.length ? this.state.posts[this.state.currentPost] : null}
prev={this.state.posts.length ? this.state.posts[this.state.prevPost] : null} prev={this.state.posts.length ? this.state.posts[this.state.prevPost] : null}
prevHandler={this.prevSlideHandler} prevHandler={this.prevSlideHandler}

View File

@ -1,9 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});