Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues #153

Merged
merged 1 commit into from
Feb 12, 2022
Merged
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
Binary file added public/assets/favicon-new-message.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/assets/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/assets/favicon-16x16.png" />
<link rel="manifest" href="%PUBLIC_URL%/assets/site.webmanifest" />
<link rel="icon" href="%PUBLIC_URL%/assets/favicon.ico" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link id="favicon" rel="icon" href="%PUBLIC_URL%/assets/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content="WorkGroup" />
<title>Initializing WorkGroup...</title>
Expand Down
20 changes: 14 additions & 6 deletions src/components/Feed/FeedCreatePostForm/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class CreatePostForm extends React.Component {
}
this.publishPost = this.publishPost.bind(this)
this.textareaRef = React.createRef(null)
this.imageInputRef = React.createRef(null)
this.fileInputRef = React.createRef(null)
}

reloadPage = () => {
Expand Down Expand Up @@ -205,9 +207,6 @@ class CreatePostForm extends React.Component {
}
}

imageInputRef = React.createRef()
fileInputRef = React.createRef()

removeUploadedImage = (index) => {
let uploadedImagesState = this.state.uploadedImages
uploadedImagesState.splice(index, 1)
Expand Down Expand Up @@ -250,6 +249,8 @@ class CreatePostForm extends React.Component {
>
<Modal.Header>Create a new post</Modal.Header>
<Modal.Content>
<input ref={this.imageInputRef} accept="image/*" type="file" onChange={this.imageChange} hidden />
<input ref={this.fileInputRef} type="file" onChange={this.fileChange} hidden />
<div
className="fake-textarea"
onPaste={() => {
Expand Down Expand Up @@ -315,7 +316,16 @@ class CreatePostForm extends React.Component {
<Modal.Actions>
<div className="left-actions">
<Popup
trigger={<Button loading={this.state.uploadImageLoading} onClick={() => this.imageInputRef.current.click()} icon="picture" basic></Button>}
trigger={
<Button
loading={this.state.uploadImageLoading}
onClick={() => {
this.imageInputRef.current.click()
}}
icon="picture"
basic
></Button>
}
content="Upload images"
position="bottom left"
/>
Expand All @@ -337,8 +347,6 @@ class CreatePostForm extends React.Component {
</Modal.Actions>
</W_Modal>
)}
<input ref={this.imageInputRef} accept="image/*" type="file" hidden onChange={this.imageChange} />
<input ref={this.fileInputRef} type="file" hidden onChange={this.fileChange} />
{this.state.successModalOpen && (
<W_Modal
onClose={() => {
Expand Down
3 changes: 3 additions & 0 deletions src/components/Feed/FeedPostItem/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export default function PostItem(props) {
<Feed.Like
href="#"
onClick={(e) => {
e.preventDefault();
likePost(e)
}}
id={'post_like_id_' + props.post.id}
Expand All @@ -162,6 +163,7 @@ export default function PostItem(props) {
href="#"
className="comment-button"
onClick={(e) => {
e.preventDefault();
commentOpener(e)
}}
id={'post_comment_id_' + props.post.id}
Expand All @@ -177,6 +179,7 @@ export default function PostItem(props) {
href="#"
className="report-button"
onClick={(e) => {
e.preventDefault();
reportPost(e, props.post.id)
}}
>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Header/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ const Header = () => {
.then((res) => res.json())
.then((res) => {
if (res > 0) {
document.getElementById('favicon').href = '/assets/favicon-new-message.ico'
setHasUnreadNotifications(true)
} else {
document.getElementById('favicon').href = '/assets/favicon.ico'
setHasUnreadNotifications(false)
}
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.hljs {
display: block;
overflow-x: auto;
padding: .5em;
padding: 0.5em;
color: #0e3560;
background: #f7f7f7;
}
Expand Down Expand Up @@ -67,4 +67,4 @@
}
.hljs-emphasis {
font-style: italic;
}
}