diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..75422e2 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.7.2-amd64 diff --git a/components/global/ArticleCard.tsx b/components/global/ArticleCard.tsx index c752f48..d3e4cf1 100644 --- a/components/global/ArticleCard.tsx +++ b/components/global/ArticleCard.tsx @@ -77,14 +77,17 @@ const StyledEmoji2 = styled.span` const StyleButton = styled(Button)` font-weight: bold; border-radius: 0.5em; - background: ${props => props.isPublished ? !props.bookmarked ? '#4EC700 !important' : '#007BED !important' : '#007BED !important'}; - border-color: ${props => props.isPublished ? !props.bookmarked ? '#4EC700 !important' : '#007BED !important' : '#007BED !important'}; + background: ${props => props.modReview ? '#007BED !important' : props.isPublished ? !props.bookmarked ? '#4EC700 !important' : '#007BED !important' : '#007BED !important'}; + border-color: ${props => props.modReview ? '#007BED !important' : props.isPublished ? !props.bookmarked ? '#4EC700 !important' : '#007BED !important' : '#007BED !important'}; ` /* article state: draft, review, pubished, complete*/ -const ArticleCard = ({ article, showAuth = false, onLeftButtonClick = null, onRightButtonClick = null, favoriteClick = null }) => { +const ArticleCard = ({ article, currentTag = null, currentOrg = null, + modReview=false, showAuth = false, onLeftButtonClick = null, onRightButtonClick = null, + favoriteClick = null}) => { + const tags = article.tagList.map((tag, i) => ( : null + } )} /> -) + ) +} -export default UserList \ No newline at end of file +export default UserList diff --git a/components/profile/GroupSetting.tsx b/components/profile/GroupSetting.tsx new file mode 100644 index 0000000..aba1941 --- /dev/null +++ b/components/profile/GroupSetting.tsx @@ -0,0 +1,156 @@ +import React from 'react'; +import styled from 'styled-components' +import { Row, Col, Card, Avatar, Button, + Space, Layout, Typography, Form, + Input, Upload } from 'antd'; +import { UserOutlined } from '@ant-design/icons'; +import UserAPI from "../../lib/api/user"; +import OrganizationsAPI from "../../lib/api/organizations"; +import TagAPI from "../../lib/api/tag"; + +import useSWR from "swr"; +import fetcher from "../../lib/utils/fetcher"; +import storage from "../../lib/utils/storage"; +import { SERVER_BASE_URL } from "../../lib/utils/constant"; + +const { Header, Footer, Sider, Content } = Layout; +const { Title, Paragraph, Text } = Typography; +const { TextArea } = Input; + +const { Search } = Input; + +const StyledCard = styled(Card)` + margin-right: 20px +` + +const GroupSetting = ({ currentOrg = null, currentTag = null, page }) => { + + const { + data: tagOrg, + error: tagOrgError, + } = currentOrg ? useSWR(`${SERVER_BASE_URL}/organizations/${currentOrg}`, fetcher) : + useSWR(`${SERVER_BASE_URL}/tags/${currentTag}`, fetcher) + + {/*returns description: etc*/} + const editDescription = desc => { + if (currentOrg) { + const description = desc.description; + OrganizationsAPI.changeOrgDescription(currentOrg, desc) + } else { + TagAPI.changeTagDescription(currentTag, desc) + } + } + + const uploadPic = pic => { + if (currentOrg) { + OrganizationsAPI.changeOrgPic(pic) + } else { + TagAPI.changeTagPic(pic) + } + } + + {/*returns string*/} + const changeSlug = slug => { + if (currentOrg) { + OrganizationsAPI.changeOrgSlug(currentOrg, slug) + } else { + TagAPI.changeTagSlug(currentTag, slug) + } + } + + {/*returns number*/} + const editModSettings = setting => { + if (currentOrg) { + OrganizationsAPI.changeModSettingOrg(currentOrg, setting) + } else { + TagAPI.changeModSettingTag(currentTag, setting) + } + } + + if (tagOrg) { + return ( + <> + + + + + + {currentOrg ? "Org Profile Pic" : "Tag Profile Pic"} + + + + + + + + + + + {currentOrg ? "Org Slug" : "Tag Slug"} + + + changeSlug(value)} + /> + + + + + {currentOrg ? "Org Description" : "Tag Description"} +
+ +