9 |
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowSyntheticDefaultImports": true
4 | },
5 | "exclude": [
6 | "node_modules"
7 | ]
8 | }
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/metro.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Metro configuration for React Native
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | */
7 | const blacklist = require('metro-config/src/defaults/blacklist');
8 |
9 | module.exports = {
10 | transformer: {
11 | getTransformOptions: async () => ({
12 | transform: {
13 | experimentalImportSupport: false,
14 | inlineRequires: false
15 | }
16 | })
17 | }
18 | };
19 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/actions/index.js:
--------------------------------------------------------------------------------
1 | export * from './loginActions';
2 | export * from './menuActions';
3 | export * from './profileActions';
4 | export * from './openChannelActions';
5 | export * from './openChannelCreateActions';
6 | export * from './chatActions';
7 | export * from './memberActions';
8 | export * from './blockUserActions';
9 | export * from './groupChannelActions';
10 | export * from './groupChannelInviteActions';
11 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/actions/loginActions.js:
--------------------------------------------------------------------------------
1 | import { INIT_LOGIN, LOGIN_SUCCESS, LOGIN_FAIL } from './types';
2 | import { sbConnect } from '../sendbirdActions';
3 |
4 | export const initLogin = () => {
5 | return { type: INIT_LOGIN };
6 | };
7 |
8 | export const sendbirdLogin = ({ userId, nickname }) => {
9 | return dispatch => {
10 | return sbConnect(userId, nickname)
11 | .then(user => loginSuccess(dispatch, user))
12 | .catch(error => loginFail(dispatch, error));
13 | };
14 | };
15 |
16 | const loginFail = (dispatch, error) => {
17 | dispatch({
18 | type: LOGIN_FAIL,
19 | payload: error
20 | });
21 | };
22 |
23 | const loginSuccess = (dispatch, user) => {
24 | dispatch({
25 | type: LOGIN_SUCCESS,
26 | payload: user
27 | });
28 | };
29 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/actions/menuActions.js:
--------------------------------------------------------------------------------
1 | import { INIT_MENU, DISCONNECT_SUCCESS } from './types';
2 | import { sbDisconnect } from '../sendbirdActions';
3 |
4 | export const initMenu = () => {
5 | return { type: INIT_MENU };
6 | };
7 |
8 | export const sendbirdLogout = () => {
9 | return dispatch => {
10 | return sbDisconnect().then(() => dispatch({ type: DISCONNECT_SUCCESS }));
11 | };
12 | };
13 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/actions/openChannelCreateActions.js:
--------------------------------------------------------------------------------
1 | import { INIT_OPEN_CHANNEL_CREATE, OPEN_CHANNEL_CREATE_SUCCESS, OPEN_CHANNEL_CREATE_FAIL } from './types';
2 | import { sbCreateOpenChannel } from '../sendbirdActions';
3 |
4 | export const initOpenChannelCreate = () => {
5 | return { type: INIT_OPEN_CHANNEL_CREATE };
6 | };
7 |
8 | export const createOpenChannel = channelName => {
9 | return dispatch => {
10 | return sbCreateOpenChannel(channelName)
11 | .then(channel =>
12 | dispatch({
13 | type: OPEN_CHANNEL_CREATE_SUCCESS,
14 | channel: channel
15 | })
16 | )
17 | .catch(error =>
18 | dispatch({
19 | type: OPEN_CHANNEL_CREATE_FAIL,
20 | error: error
21 | })
22 | );
23 | };
24 | };
25 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/appStateChangeHandler.js:
--------------------------------------------------------------------------------
1 | export default (function() {
2 | var instance;
3 |
4 | function AppStateChangeHandler() {
5 | this.cbs = {};
6 | this.addCallback = (key, cb) => {
7 | this.cbs[key] = cb;
8 | return () => {
9 | delete this.cbs[key];
10 | };
11 | };
12 |
13 | this.notify = () => {
14 | for (let key in this.cbs) {
15 | this.cbs[key]();
16 | }
17 | };
18 | }
19 |
20 | return {
21 | getInstance: function() {
22 | if (!instance) {
23 | instance = new AppStateChangeHandler();
24 | }
25 | return instance;
26 | }
27 | };
28 | })();
29 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/components/Hr.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { View } from 'react-native';
3 |
4 | class HR extends Component {
5 | render() {
6 | return ;
7 | }
8 | }
9 |
10 | const styles = {
11 | lineStyle: {
12 | flexDirection: 'row',
13 | alignItems: 'center',
14 | height: 1,
15 | backgroundColor: '#e6e6e6'
16 | }
17 | };
18 |
19 | export { HR };
20 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/components/Spinner.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import SpinnerComponent from 'react-native-loading-spinner-overlay';
3 |
4 | class Spinner extends Component {
5 | render() {
6 | return ;
7 | }
8 | }
9 |
10 | export { Spinner };
11 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/components/index.js:
--------------------------------------------------------------------------------
1 | export * from './Spinner';
2 | export * from './Message';
3 | export * from './MessageItem';
4 | export * from './ImageItem';
5 | export * from './MessageInput';
6 | export * from './Hr';
7 | export * from './MessageContainer';
8 | export * from './MessageAvatar';
9 | export * from './MessageBubble';
10 | export { Button, Icon, Avatar, FormLabel, FormInput, FormValidationMessage, ListItem } from 'react-native-elements';
11 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/img/icon_sb_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react-native/react-native-redux/ReactNativeWithSendBird/src/img/icon_sb_256.png
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/img/icon_sb_34.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react-native/react-native-redux/ReactNativeWithSendBird/src/img/icon_sb_34.png
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/img/icon_sb_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react-native/react-native-redux/ReactNativeWithSendBird/src/img/icon_sb_512.png
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/img/icon_sb_68.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react-native/react-native-redux/ReactNativeWithSendBird/src/img/icon_sb_68.png
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/reducers/loginReducer.js:
--------------------------------------------------------------------------------
1 | import { INIT_LOGIN, LOGIN_SUCCESS, LOGIN_FAIL } from '../actions/types';
2 |
3 | const INITIAL_STATE = {
4 | error: '',
5 | user: null
6 | };
7 |
8 | export default (state = INITIAL_STATE, action) => {
9 | switch (action.type) {
10 | case INIT_LOGIN:
11 | return { ...state, ...INITIAL_STATE };
12 | case LOGIN_SUCCESS:
13 | return { ...state, ...INITIAL_STATE, user: action.payload };
14 | case LOGIN_FAIL:
15 | return { ...state, ...INITIAL_STATE, error: action.payload };
16 | default:
17 | return state;
18 | }
19 | };
20 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/reducers/memberReducer.js:
--------------------------------------------------------------------------------
1 | import { INIT_MEMBER, MEMBER_LIST_SUCCESS, MEMBER_LIST_FAIL } from '../actions/types';
2 |
3 | const INITAL_STATE = {
4 | list: []
5 | };
6 |
7 | export default (state = INITAL_STATE, action) => {
8 | switch (action.type) {
9 | case INIT_MEMBER:
10 | return { ...state, ...INITAL_STATE };
11 | case MEMBER_LIST_SUCCESS:
12 | return { ...state, list: action.list };
13 | case MEMBER_LIST_FAIL:
14 | return { ...state, list: [] };
15 | default:
16 | return state;
17 | }
18 | };
19 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/reducers/menuReducer.js:
--------------------------------------------------------------------------------
1 | import { INIT_MENU, DISCONNECT_SUCCESS } from '../actions/types';
2 |
3 | const INITIAL_STATE = {
4 | isDisconnected: false
5 | };
6 |
7 | export default (state = INITIAL_STATE, action) => {
8 | switch (action.type) {
9 | case INIT_MENU:
10 | return { ...state, ...INITIAL_STATE };
11 | case DISCONNECT_SUCCESS:
12 | return { ...state, isDisconnected: true };
13 | default:
14 | return state;
15 | }
16 | };
17 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/reducers/openChannelCreateReducer.js:
--------------------------------------------------------------------------------
1 | import { INIT_OPEN_CHANNEL_CREATE, OPEN_CHANNEL_CREATE_SUCCESS, OPEN_CHANNEL_CREATE_FAIL } from '../actions/types';
2 |
3 | const INITAL_STATE = {
4 | error: '',
5 | channel: null
6 | };
7 |
8 | export default (state = INITAL_STATE, action) => {
9 | switch (action.type) {
10 | case INIT_OPEN_CHANNEL_CREATE:
11 | return { ...state, ...INITAL_STATE };
12 | case OPEN_CHANNEL_CREATE_SUCCESS:
13 | return { ...state, ...INITAL_STATE, channel: action.channel };
14 | case OPEN_CHANNEL_CREATE_FAIL:
15 | return { ...state, ...INITAL_STATE, error: action.error };
16 | default:
17 | return state;
18 | }
19 | };
20 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/reducers/profileReducer.js:
--------------------------------------------------------------------------------
1 | import { INIT_PROFILE, GET_PROFILE_SUCCESS, UPDATE_PROFILE_SUCCESS, UPDATE_PROFILE_FAIL } from '../actions/types';
2 |
3 | const INITIAL_STATE = {
4 | userInfo: null,
5 | error: '',
6 | isSaved: false
7 | };
8 |
9 | export default (state = INITIAL_STATE, action) => {
10 | switch (action.type) {
11 | case INIT_PROFILE:
12 | return { ...state, ...INITIAL_STATE };
13 | case GET_PROFILE_SUCCESS:
14 | return { ...state, userInfo: action.userInfo };
15 | case UPDATE_PROFILE_SUCCESS:
16 | return { ...state, error: '', isSaved: true };
17 | case UPDATE_PROFILE_FAIL:
18 | return { ...state, error: action.error, isSaved: false };
19 | default:
20 | return state;
21 | }
22 | };
23 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/sendbirdActions/index.js:
--------------------------------------------------------------------------------
1 | export * from './utils';
2 | export * from './user';
3 | export * from './openChannel';
4 | export * from './groupChannel';
5 | export * from './chat';
6 |
--------------------------------------------------------------------------------
/react-native/react-native-redux/ReactNativeWithSendBird/src/store/index.js:
--------------------------------------------------------------------------------
1 | import { createStore, compose, applyMiddleware } from 'redux';
2 | import thunk from 'redux-thunk';
3 | import reducers from '../reducers';
4 |
5 | const store = createStore(reducers, {}, compose(applyMiddleware(thunk)));
6 |
7 | export default store;
8 |
--------------------------------------------------------------------------------
/react/react-app-composed/.env.example:
--------------------------------------------------------------------------------
1 | # Rename this file to .env and input correct values to use
2 | # Your App Id
3 | APP_ID=xxx
4 | # This is a trick to make scripts work in deployment
5 | # before: `/assets/main.js` after `./assets/main.js`
6 | PUBLIC_URL=./
7 |
--------------------------------------------------------------------------------
/react/react-app-composed/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-app-composed/config/jest/cssTransform.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // This is a custom Jest transformer turning style imports into empty objects.
4 | // http://facebook.github.io/jest/docs/en/webpack.html
5 |
6 | module.exports = {
7 | process() {
8 | return 'module.exports = {};';
9 | },
10 | getCacheKey() {
11 | // The output is always the same.
12 | return 'cssTransform';
13 | },
14 | };
15 |
--------------------------------------------------------------------------------
/react/react-app-composed/config/pnpTs.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { resolveModuleName } = require('ts-pnp');
4 |
5 | exports.resolveModuleName = (
6 | typescript,
7 | moduleName,
8 | containingFile,
9 | compilerOptions,
10 | resolutionHost
11 | ) => {
12 | return resolveModuleName(
13 | moduleName,
14 | containingFile,
15 | compilerOptions,
16 | resolutionHost,
17 | typescript.resolveModuleName
18 | );
19 | };
20 |
21 | exports.resolveTypeReferenceDirective = (
22 | typescript,
23 | moduleName,
24 | containingFile,
25 | compilerOptions,
26 | resolutionHost
27 | ) => {
28 | return resolveModuleName(
29 | moduleName,
30 | containingFile,
31 | compilerOptions,
32 | resolutionHost,
33 | typescript.resolveTypeReferenceDirective
34 | );
35 | };
36 |
--------------------------------------------------------------------------------
/react/react-app-composed/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react/react-app-composed/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-app-composed/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react/react-app-composed/public/logo192.png
--------------------------------------------------------------------------------
/react/react-app-composed/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react/react-app-composed/public/logo512.png
--------------------------------------------------------------------------------
/react/react-app-composed/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/react/react-app-composed/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/react/react-app-composed/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: inherit;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/react/react-app-composed/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react';
2 | import './App.css';
3 |
4 | import {
5 | BrowserRouter as Router,
6 | Switch,
7 | Route,
8 | } from 'react-router-dom';
9 |
10 | import Login from './Login';
11 | import Chat from './Chat';
12 |
13 | function App() {
14 | const [config, setconfig] = useState({});
15 | return (
16 |
17 |
18 |
19 |
20 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | );
33 | }
34 |
35 | export default App;
36 |
--------------------------------------------------------------------------------
/react/react-app-composed/src/Chat.css:
--------------------------------------------------------------------------------
1 | .sendbird-app__wrap {
2 | width: 100%;
3 | height: 100%;
4 | display: flex;
5 | }
6 | .sendbird-app__channellist-wrap {
7 | max-width: 320px;
8 | }
9 | .sendbird-app__conversation-wrap {
10 | flex: 1;
11 | position: relative;
12 | }
13 | .sendbird-app__settingspanel-wrap {
14 | position: fixed;
15 | top: 0;
16 | right: 0;
17 | height: 100%;
18 | }
19 |
--------------------------------------------------------------------------------
/react/react-app-composed/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/react/react-app-composed/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './index.css';
4 | import App from './App';
5 | import * as serviceWorker from './serviceWorker';
6 |
7 | ReactDOM.render(
8 |
9 |
10 | ,
11 | document.getElementById('root')
12 | );
13 |
14 | // If you want your app to work offline and load faster, you can change
15 | // unregister() to register() below. Note this comes with some pitfalls.
16 | // Learn more about service workers: https://bit.ly/CRA-PWA
17 | serviceWorker.unregister();
18 |
--------------------------------------------------------------------------------
/react/react-app-composed/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect';
6 |
--------------------------------------------------------------------------------
/react/react-app-custom/.env.example:
--------------------------------------------------------------------------------
1 | # Rename this file to .env and input correct values to use
2 | APP_ID=xxx
3 |
4 | # This is a trick to make scripts work in deployment
5 | # before: `/assets/main.js` after `./assets/main.js`
6 | PUBLIC_URL=./
7 |
--------------------------------------------------------------------------------
/react/react-app-custom/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-app-custom/config/jest/cssTransform.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // This is a custom Jest transformer turning style imports into empty objects.
4 | // http://facebook.github.io/jest/docs/en/webpack.html
5 |
6 | module.exports = {
7 | process() {
8 | return 'module.exports = {};';
9 | },
10 | getCacheKey() {
11 | // The output is always the same.
12 | return 'cssTransform';
13 | },
14 | };
15 |
--------------------------------------------------------------------------------
/react/react-app-custom/config/pnpTs.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { resolveModuleName } = require('ts-pnp');
4 |
5 | exports.resolveModuleName = (
6 | typescript,
7 | moduleName,
8 | containingFile,
9 | compilerOptions,
10 | resolutionHost
11 | ) => {
12 | return resolveModuleName(
13 | moduleName,
14 | containingFile,
15 | compilerOptions,
16 | resolutionHost,
17 | typescript.resolveModuleName
18 | );
19 | };
20 |
21 | exports.resolveTypeReferenceDirective = (
22 | typescript,
23 | moduleName,
24 | containingFile,
25 | compilerOptions,
26 | resolutionHost
27 | ) => {
28 | return resolveModuleName(
29 | moduleName,
30 | containingFile,
31 | compilerOptions,
32 | resolutionHost,
33 | typescript.resolveTypeReferenceDirective
34 | );
35 | };
36 |
--------------------------------------------------------------------------------
/react/react-app-custom/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react/react-app-custom/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-app-custom/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react/react-app-custom/public/logo192.png
--------------------------------------------------------------------------------
/react/react-app-custom/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react/react-app-custom/public/logo512.png
--------------------------------------------------------------------------------
/react/react-app-custom/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/react/react-app-custom/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/react/react-app-custom/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/react/react-app-custom/src/Chat/index.css:
--------------------------------------------------------------------------------
1 | .sendbird-app__wrap {
2 | width: 100%;
3 | height: 100%;
4 | display: flex;
5 | }
6 | .sendbird-app__channellist-wrap {
7 | max-width: 320px;
8 | }
9 | .sendbird-app__conversation-wrap {
10 | flex: 1;
11 | position: relative;
12 | }
13 | .sendbird-app__settingspanel-wrap {
14 | position: fixed;
15 | top: 0;
16 | right: 0;
17 | height: 100%;
18 | }
19 |
--------------------------------------------------------------------------------
/react/react-app-custom/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/react/react-app-custom/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './index.css';
4 | import App from './App';
5 | import * as serviceWorker from './serviceWorker';
6 |
7 | ReactDOM.render(
8 |
9 |
10 | ,
11 | document.getElementById('root')
12 | );
13 |
14 | // If you want your app to work offline and load faster, you can change
15 | // unregister() to register() below. Note this comes with some pitfalls.
16 | // Learn more about service workers: https://bit.ly/CRA-PWA
17 | serviceWorker.unregister();
18 |
--------------------------------------------------------------------------------
/react/react-app-custom/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect';
6 |
--------------------------------------------------------------------------------
/react/react-app-simple/.env.example:
--------------------------------------------------------------------------------
1 | # Rename this file to .env and input correct values to use
2 | # Your App Id
3 | APP_ID=xxx
4 | # This is a trick to make scripts work in deployment
5 | # before: `/assets/main.js` after `./assets/main.js`
6 | PUBLIC_URL=./
7 |
--------------------------------------------------------------------------------
/react/react-app-simple/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-app-simple/config/jest/cssTransform.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // This is a custom Jest transformer turning style imports into empty objects.
4 | // http://facebook.github.io/jest/docs/en/webpack.html
5 |
6 | module.exports = {
7 | process() {
8 | return 'module.exports = {};';
9 | },
10 | getCacheKey() {
11 | // The output is always the same.
12 | return 'cssTransform';
13 | },
14 | };
15 |
--------------------------------------------------------------------------------
/react/react-app-simple/config/pnpTs.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const { resolveModuleName } = require('ts-pnp');
4 |
5 | exports.resolveModuleName = (
6 | typescript,
7 | moduleName,
8 | containingFile,
9 | compilerOptions,
10 | resolutionHost
11 | ) => {
12 | return resolveModuleName(
13 | moduleName,
14 | containingFile,
15 | compilerOptions,
16 | resolutionHost,
17 | typescript.resolveModuleName
18 | );
19 | };
20 |
21 | exports.resolveTypeReferenceDirective = (
22 | typescript,
23 | moduleName,
24 | containingFile,
25 | compilerOptions,
26 | resolutionHost
27 | ) => {
28 | return resolveModuleName(
29 | moduleName,
30 | containingFile,
31 | compilerOptions,
32 | resolutionHost,
33 | typescript.resolveTypeReferenceDirective
34 | );
35 | };
36 |
--------------------------------------------------------------------------------
/react/react-app-simple/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react/react-app-simple/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-app-simple/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react/react-app-simple/public/logo192.png
--------------------------------------------------------------------------------
/react/react-app-simple/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sendbird/sendbird-javascript-samples/d6d09a3714cb1889d56a2582739196e9d6e0bd7b/react/react-app-simple/public/logo512.png
--------------------------------------------------------------------------------
/react/react-app-simple/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/react/react-app-simple/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/react/react-app-simple/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | height: 99vh;
4 | }
5 |
6 | .App-logo {
7 | height: 40vmin;
8 | pointer-events: none;
9 | }
10 |
11 | @media (prefers-reduced-motion: no-preference) {
12 | .App-logo {
13 | animation: App-logo-spin infinite 20s linear;
14 | }
15 | }
16 |
17 | .App-header {
18 | background-color: #282c34;
19 | min-height: 100vh;
20 | display: flex;
21 | flex-direction: column;
22 | align-items: center;
23 | justify-content: center;
24 | font-size: calc(10px + 2vmin);
25 | color: white;
26 | }
27 |
28 | .App-link {
29 | color: #61dafb;
30 | }
31 |
32 | @keyframes App-logo-spin {
33 | from {
34 | transform: rotate(0deg);
35 | }
36 | to {
37 | transform: rotate(360deg);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/react/react-app-simple/src/App.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import logo from './logo.svg';
3 | import './App.css';
4 |
5 | import { App as SendBirdApp } from 'sendbird-uikit';
6 | import 'sendbird-uikit/dist/index.css';
7 |
8 | function App() {
9 | return (
10 |
11 |
16 |
17 | );
18 | }
19 |
20 | export default App;
21 |
--------------------------------------------------------------------------------
/react/react-app-simple/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/react/react-app-simple/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './index.css';
4 | import App from './App';
5 | import * as serviceWorker from './serviceWorker';
6 |
7 | ReactDOM.render(
8 |
9 |
10 | ,
11 | document.getElementById('root')
12 | );
13 |
14 | // If you want your app to work offline and load faster, you can change
15 | // unregister() to register() below. Note this comes with some pitfalls.
16 | // Learn more about service workers: https://bit.ly/CRA-PWA
17 | serviceWorker.unregister();
18 |
--------------------------------------------------------------------------------
/react/react-app-simple/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect';
6 |
--------------------------------------------------------------------------------