Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/components/Modqueue/CommunityRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ function CommunityRules() {
<Select
value={selectedSubreddit}
onChange={handleSubredditChange}
data-testid="subreddit-select"
labelId="subreddit-label"
>
{subreddits.map((subreddit) => (
<MenuItem key={subreddit.id} value={subreddit.id}>
Expand All @@ -128,7 +130,7 @@ function CommunityRules() {
</table>
<Card>
<CardContent>
{console.log('rendering rule ', rules)}

{rules.map((rule, index) => (
<Card key={index} style={{
margin: '10px 0'
Expand Down Expand Up @@ -174,4 +176,13 @@ function CommunityRules() {
);
}

export default CommunityRules;
export default CommunityRules;

CommunityRules.propTypes = {
subreddit: PropTypes.string,
rules: PropTypes.array,
selectedSubreddit: PropTypes.string,
newRule: PropTypes.object,
open: PropTypes.bool

}
13 changes: 12 additions & 1 deletion src/components/Modqueue/CommunitySettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
import { Button, TextField, FormControl, InputLabel, Select, MenuItem, Checkbox, FormControlLabel, Card, CardContent, Typography, CardHeader, Avatar, IconButton, Box, List, ListItem, ListItemText, Divider, Menu, TextareaAutosize } from '@mui/material';
import MoreVertIcon from '@mui/icons-material/MoreVert';
import axios from "axios";
import PropTypes from 'prop-types';


function CommunitySettings() {
Expand Down Expand Up @@ -138,4 +139,14 @@ function CommunitySettings() {
);
}

export default CommunitySettings;
export default CommunitySettings;

CommunitySettings.propTypes = {
subreddits: PropTypes.array.isRequired,
selectedSubreddit: PropTypes.number.isRequired,
settings: PropTypes.object.isRequired,
settingsDescriptions: PropTypes.object.isRequired,
communityTypes: PropTypes.array.isRequired,
handleSubredditChange: PropTypes.func.isRequired,
handleUpdate: PropTypes.func.isRequired,
}
18 changes: 18 additions & 0 deletions src/components/Modqueue/Edited.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,21 @@ function Edited() {
Edited.propTypes = {};

export default Edited;

Edited.propTypes ={
removedPosts: PropTypes.array,
approvedPosts: PropTypes.array,
setApprovedPosts: PropTypes.func,
setRemovedPosts: PropTypes.func,
selectedSubreddit: PropTypes.object,
setSelectedSubreddit: PropTypes.func,
subreddits: PropTypes.array,
setSubreddits: PropTypes.func,
anchorEl: PropTypes.object,
setAnchorEl: PropTypes.func,
handleClick: PropTypes.func,
handleClose: PropTypes.func



}
15 changes: 12 additions & 3 deletions src/components/Modqueue/ModerationRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import React, { useEffect, useState } from 'react';
import { Select, MenuItem, Button, Grid, Typography, Box, useTheme } from '@mui/material';
import axios from 'axios';
import { responsiveFontSizes, ThemeProvider } from '@mui/material/styles';



import PropTypes from 'prop-types';
function ModerationRoles() {
const [subreddits, setSubreddits] = useState([]);
const [selectedSubreddit, setSelectedSubreddit] = useState('');
Expand Down Expand Up @@ -112,3 +110,14 @@ function ModerationRoles() {
}

export default ModerationRoles;

ModerationRoles.propTypes = {
subreddits: PropTypes.array,
selectedSubreddit: PropTypes.object,
username: PropTypes.array,
selectedUser: PropTypes.string,
handleInvite: PropTypes.func,
handleLeave: PropTypes.func,
handleBan: PropTypes.func,
handleUnban: PropTypes.func,
}
15 changes: 12 additions & 3 deletions src/components/Modqueue/Removed.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import './Removed.css';
import PostContainer2 from "../PostCointainer2";

function Unmoderated() {
function Removed() {
const [subreddits, setSubreddits] = useState([]);
const [selectedSubreddit, setSelectedSubreddit] = useState('');
const [removedPosts, setRemovedPosts] = useState([]);
Expand Down Expand Up @@ -105,6 +105,15 @@ function Unmoderated() {
}


Unmoderated.propTypes = {};

export default Unmoderated;

export default Removed;


Removed.prototype = {
subreddits: PropTypes.array,
selectedSubreddit: PropTypes.object,
removedPosts: PropTypes.array,
approvedPosts: PropTypes.object

}
12 changes: 11 additions & 1 deletion src/components/Modqueue/Unmoderated.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ function Unmoderated() {
}


Unmoderated.propTypes = {};


export default Unmoderated;


Unmoderated.propTypes = {
subreddits: PropTypes.array,
removedPosts: PropTypes.array,
approvedPosts: PropTypes.array,
handleApprove: PropTypes.func,
handleDisapprove: PropTypes.func

}
38 changes: 6 additions & 32 deletions src/components/Notification/Notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,36 +303,10 @@ Notification.propTypes = {
* The type of notification
*/
type: propTypes.oneOf(['comment', 'message', 'chat', 'friendRequest', 'newPost', 'report']),
/**
* The user name
*/
userName: propTypes.string,
/**
* The recipient user ID
*/
recipientUserId: propTypes.string,
/**
* The sender user email
*/
senderUserEmail: propTypes.string,
/**
* The sender user ID
*/
senderUserId: propTypes.string,
/**
* The thread ID
*/
threadID: propTypes.string,
/**
* The thread data
*/
threadData: propTypes.string,
/**
* The timestamp
*/
timestamp: propTypes.string,
/**
* The read status
*/
isRead: propTypes.string,
setNotificationCount: propTypes.func.isRequired,

contentID: propTypes.object.isRequired,
content: propTypes.string.isRequired,
createdAt: propTypes.string.isRequired,
read: propTypes.bool.isRequired,
}
43 changes: 7 additions & 36 deletions src/components/Notification/oldnotifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,41 +295,12 @@ const OldNotification = ({setNotificationCount}) => {

export default OldNotification;

Notification.propTypes = {
/**
* The type of notification
*/
OldNotification.propTypes = {
type: propTypes.oneOf(['comment', 'message', 'chat', 'friendRequest', 'newPost', 'report']),
/**
* The user name
*/
userName: propTypes.string,
/**
* The recipient user ID
*/
recipientUserId: propTypes.string,
/**
* The sender user email
*/
senderUserEmail: propTypes.string,
/**
* The sender user ID
*/
senderUserId: propTypes.string,
/**
* The thread ID
*/
threadID: propTypes.string,
/**
* The thread data
*/
threadData: propTypes.string,
/**
* The timestamp
*/
timestamp: propTypes.string,
/**
* The read status
*/
isRead: propTypes.string,
setNotificationCount: propTypes.func.isRequired,

contentID: propTypes.object.isRequired,
content: propTypes.string.isRequired,
createdAt: propTypes.string.isRequired,
read: propTypes.bool.isRequired,
}
Loading