handling for more errors, new favicon
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
theme: jekyll-theme-minimal
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import './App.css';
|
import './App.css';
|
||||||
import Navbar from './features/navbar/Navbar';
|
import Navbar from './features/navbar/Navbar';
|
||||||
import Post from './features/posts/Post';
|
|
||||||
import Feed from './features/posts/Feed';
|
import Feed from './features/posts/Feed';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, /* useSelector */ } from 'react-redux';
|
||||||
import { unwrapResult } from '@reduxjs/toolkit';
|
import { unwrapResult } from '@reduxjs/toolkit';
|
||||||
import { fetchComments, isPending } from '../posts/postsSlice';
|
import { fetchComments } from '../posts/postsSlice';
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
|
|
||||||
export default function Discussion({permalink, isVisible}) {
|
export default function Discussion({permalink, isVisible}) {
|
||||||
@@ -9,12 +9,8 @@ export default function Discussion({permalink, isVisible}) {
|
|||||||
const [data, setData] = useState(null);
|
const [data, setData] = useState(null);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const isLoading = useSelector(isPending);
|
|
||||||
|
|
||||||
const formattedLink = permalink.substring(0,(permalink.length-1));
|
const formattedLink = permalink.substring(0,(permalink.length-1));
|
||||||
|
|
||||||
let deps = [isVisible, data, setData, thread, setThread, formattedLink, dispatch];
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let isActive = true;
|
let isActive = true;
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
|
|||||||
@@ -1,18 +1,16 @@
|
|||||||
import React, { useRef, useState } from "react";
|
import React, { useRef, useState } from "react";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, /* useDispatch */ } from "react-redux";
|
||||||
import { selectAllSubs } from "../reddit/redditSlice";
|
import { selectAllSubs } from "../reddit/redditSlice";
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
import SidebarItem from "./SidebarItem";
|
import SidebarItem from "./SidebarItem";
|
||||||
import './Sidebar.css';
|
import './Sidebar.css';
|
||||||
|
|
||||||
export default function Sidebar({isCollapsed}) {
|
export default function Sidebar({isCollapsed}) {
|
||||||
const dispatch = useDispatch();
|
|
||||||
|
|
||||||
const allSubs = useSelector(selectAllSubs);
|
const allSubs = useSelector(selectAllSubs);
|
||||||
let arrayOfSubs = Object.keys(allSubs);
|
let arrayOfSubs = Object.keys(allSubs);
|
||||||
|
|
||||||
const [subs, setSubs] = useState(arrayOfSubs);
|
// const [subs, setSubs] = useState(arrayOfSubs); // this piece of state to be used to modify state based on a dispatched action
|
||||||
const [searchSubs, setSearchSubs] = useState('');
|
const [searchSubs, setSearchSubs] = useState(''); // from sidebaritems when the visibility of a sub is toggled on/off
|
||||||
|
|
||||||
const searchWindowStyle = useRef('search-inactive'); // this ref allows us to access and modify the class of the search window container from another part of the render function
|
const searchWindowStyle = useRef('search-inactive'); // this ref allows us to access and modify the class of the search window container from another part of the render function
|
||||||
|
|
||||||
@@ -31,8 +29,8 @@ export default function Sidebar({isCollapsed}) {
|
|||||||
<>
|
<>
|
||||||
{/* isCollapsed is passed from the parent component, and is mutable within the navbar */}
|
{/* isCollapsed is passed from the parent component, and is mutable within the navbar */}
|
||||||
<div className={isCollapsed ? 'sidebar-hidden' : 'sidebar'}>
|
<div className={isCollapsed ? 'sidebar-hidden' : 'sidebar'}>
|
||||||
{
|
{ // arrayOfSubs will become subs from useState on implementation of useState
|
||||||
subs.map((sub) => { // Maps each sub to its own line within the sidebar, along with a button that toggles its "isSelected" property
|
arrayOfSubs.map((sub) => { // Maps each sub to its own line within the sidebar, along with a button that toggles its "isSelected" property
|
||||||
return (
|
return (
|
||||||
<SidebarItem sub={sub} key={v4()}/>
|
<SidebarItem sub={sub} key={v4()}/>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useDispatch } from "react-redux";
|
// import { useDispatch } from "react-redux";
|
||||||
import { updateSubVisibility } from "../reddit/redditSlice";
|
// import { updateSubVisibility } from "../reddit/redditSlice";
|
||||||
|
|
||||||
export default function SidebarItem({sub}) {
|
export default function SidebarItem({sub}) {
|
||||||
const [visible, setVisible] = useState('hide');
|
const [visible, setVisible] = useState('hide'); // dispatch will be used to dispatch updateSubVisibility on change in state
|
||||||
const dispatch = useDispatch();
|
// const dispatch = useDispatch(); // this will likely be within a useEffect hook
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
if (visible === 'hide') {
|
if (visible === 'hide') {
|
||||||
|
|||||||
Reference in New Issue
Block a user