Swapped out a library

This commit is contained in:
2021-12-27 03:34:00 +00:00
parent d486059430
commit 55ff5765c6
3 changed files with 215 additions and 494 deletions
@@ -1,5 +1,5 @@
import React, { useState, useEffect, useContext, useRef } from 'react';
import Select from 'react-dropdown-select';
import Select from 'react-select';
import { TokenContext } from '../../utilities/token-provider';
@@ -39,11 +39,9 @@ const NewsEditor = props => {
<div className='panel'>
<h2 className='text centered'>News Editor</h2>
<Select
options={articles.map(article => { return { label: article.title, value: article.index }; })}
onChange={async values => {
options={articles.map(article => { return { label: article.title, index: article.index }; })}
onChange={async ({index}) => {
//fetch this article
const index = values[0].value;
const result = await fetch(`${process.env.NEWS_URI}/news/archive/${index}`, {
headers: {
'Access-Control-Allow-Origin': '*'
+212 -489
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -43,10 +43,10 @@
"raw-loader": "^4.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-dropdown-select": "^4.7.4",
"react-markdown": "^6.0.2",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-select": "^5.2.1",
"rehype-raw": "^5.1.0",
"sequelize": "^6.6.5",
"socket.io-client": "^4.1.3",