Skip to content

Commit

Permalink
etc
Browse files Browse the repository at this point in the history
  • Loading branch information
danney-chun committed Oct 7, 2024
1 parent e37f816 commit ba99b88
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 42 deletions.
27 changes: 1 addition & 26 deletions .github/workflows/deploy-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,9 @@ jobs:
CI: false # ESLint 에러 무시
PUBLIC_URL: https://sendbird.github.io/sendbird-chat-sample-react

- name: List build directory
run: ls -R build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
force_orphan: true

- name: Check deployment
run: |
echo "Deployment to gh-pages branch completed."
echo "GitHub Pages should now be building from the gh-pages branch."
echo "Please allow a few minutes for the changes to propagate."
- name: Provide next steps
run: |
echo "If your site is not visible after a few minutes, please check:"
echo "1. The 'Actions' tab for any errors in the workflow run"
echo "2. The 'gh-pages' branch in your repository to ensure content was pushed"
echo "3. Your repository settings under 'Pages' to confirm the source is set to gh-pages branch"
- name: Check build output
run: |
echo "Build directory contents:"
ls -R build
echo "Checking for key files:"
[ -f build/index.html ] && echo "index.html exists" || echo "index.html is missing"
[ -f build/manifest.json ] && echo "manifest.json exists" || echo "manifest.json is missing"
[ -d build/static ] && echo "static directory exists" || echo "static directory is missing"

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
},
"scripts": {
"start": "react-scripts start",
"build": "GENERATE_SOURCEMAP=true react-scripts build",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
Expand Down
23 changes: 11 additions & 12 deletions src/samples/GroupChannelRetrieveNumberOfMembersHaventReadMessage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

import { useState, useEffect, useRef } from 'react';
import { v4 as uuid } from 'uuid';
import SendbirdChat from '@sendbird/chat';
import {
GroupChannelModule,
Expand Down Expand Up @@ -165,7 +164,7 @@ const GroupChannelRetrieveNumberOfMembersHaventReadMessage = (props) => {
}

const handleCreateChannel = async (channelName = "testChannel",) => {
const [groupChannel, error] = await createChannel(channelName, state.groupChannelMembers);
const [error] = await createChannel(channelName, state.groupChannelMembers);
if (error) {
return onError(error);
}
Expand All @@ -178,7 +177,7 @@ const GroupChannelRetrieveNumberOfMembersHaventReadMessage = (props) => {
}

const handleDeleteChannel = async (channelUrl) => {
const [channel, error] = await deleteChannel(channelUrl);
const [error] = await deleteChannel(channelUrl);
if (error) {
return onError(error);
}
Expand Down Expand Up @@ -215,7 +214,7 @@ const GroupChannelRetrieveNumberOfMembersHaventReadMessage = (props) => {
const userMessageUpdateParams = {};
userMessageUpdateParams.message = state.messageInputValue;
const updatedMessage = await currentlyJoinedChannel.updateUserMessage(messageToUpdate.messageId, userMessageUpdateParams)
const messageIndex = messages.findIndex((item => item.messageId == messageToUpdate.messageId));
const messageIndex = messages.findIndex((item => item.messageId === messageToUpdate.messageId));
messages[messageIndex] = updatedMessage;
updateState({ ...state, messages: messages, messageInputValue: "", messageToUpdate: null });
} else {
Expand All @@ -235,7 +234,7 @@ const GroupChannelRetrieveNumberOfMembersHaventReadMessage = (props) => {

const onFileInputChange = async (e) => {
if (e.currentTarget.files && e.currentTarget.files.length > 0) {
const { currentlyJoinedChannel, messages } = state;
const { currentlyJoinedChannel } = state;
const fileMessageParams = {};
fileMessageParams.file = e.currentTarget.files[0];
currentlyJoinedChannel.sendFileMessage(fileMessageParams)
Expand Down Expand Up @@ -398,7 +397,7 @@ const ChannelList = ({
</div>
<div>
<button className="control-button" onClick={() => handleDeleteChannel(channel.url)}>
<img className="channel-icon" src='/icon_delete.png' />
<img className="channel-icon" src='/icon_delete.png' alt=''/>
</button>
</div>
</div>
Expand Down Expand Up @@ -485,9 +484,9 @@ const Message = ({ message, updateMessage, handleDeleteMessage, messageSentByYou
<div className="message-sender-name">{message.sender.nickname}{' '}</div>
<div>{timestampToTime(message.createdAt)}</div>
</div>
{messageSentByCurrentUser && <div><button className="control-button number-of-undelivered-message-btn" data-title="Get number of unread members" onClick={() => getNumberOfUnreadMembers(message)}><img className="message-icon" src='/unread_icon.png' /></button></div>}
{messageSentByCurrentUser && <div><button className="control-button number-of-undelivered-message-btn" data-title="Get number of unread members" onClick={() => getNumberOfUnreadMembers(message)}><img className="message-icon" src='/unread_icon.png' alt=''/></button></div>}
</div>
<img src={message.url} />
<img src={message.url} alt=''/>
{showNumberOfUnreadMembers && <div className="number-of-undelivered-members">Number of members unread a message: {numberOfUnreadMembers}<span className="number-of-undelivered-members-btn" onClick={closeNumberOfUnreadMembers}>&#10006;</span></div>}
</div>
);
Expand All @@ -502,9 +501,9 @@ const Message = ({ message, updateMessage, handleDeleteMessage, messageSentByYou
</div>
{messageSentByCurrentUser &&
<div>
<button className="control-button" onClick={() => updateMessage(message)}><img className="message-icon" src='/icon_edit.png' /></button>
<button className="control-button" onClick={() => handleDeleteMessage(message)}><img className="message-icon" src='/icon_delete.png' /></button>
<button className="control-button number-of-undelivered-message-btn" data-title="Get number of unread members" onClick={() => getNumberOfUnreadMembers(message)}><img className="message-icon" src='/unread_icon.png' /></button>
<button className="control-button" onClick={() => updateMessage(message)}><img className="message-icon" src='/icon_edit.png' alt=''/></button>
<button className="control-button" onClick={() => handleDeleteMessage(message)}><img className="message-icon" src='/icon_delete.png' alt=''/></button>
<button className="control-button number-of-undelivered-message-btn" data-title="Get number of unread members" onClick={() => getNumberOfUnreadMembers(message)}><img className="message-icon" src='/unread_icon.png' alt=''/></button>
</div>
}
</div>
Expand All @@ -516,7 +515,7 @@ const Message = ({ message, updateMessage, handleDeleteMessage, messageSentByYou

const ProfileImage = ({ user }) => {
if (user.plainProfileUrl) {
return <img className="profile-image" src={user.plainProfileUrl} />
return <img className="profile-image" src={user.plainProfileUrl} alt=''/>
} else {
return <div className="profile-image-fallback">{user.nickname.charAt(0)}</div>;
}
Expand Down

0 comments on commit ba99b88

Please sign in to comment.