Skip to content

Commit

Permalink
Merge pull request #288 from rairprotocol/dev
Browse files Browse the repository at this point in the history
update main branch with latest changes
  • Loading branch information
sarora180673 authored Nov 25, 2024
2 parents 32dab3f + 48e592a commit 5d7c3e0
Show file tree
Hide file tree
Showing 70 changed files with 4,909 additions and 893 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ RAIR deploys each its services in a self-contained Docker image:

It's the moment of truth. From the repository root, run:

docker-compose -f {dockerfile.yml} up
docker-compose -f docker-compose.local-new.yml up -d

`{dockerfile.yml}` will be the file configured for your specific deployment. Wait for the app to build. Keep an eye on the terminal for any errors.
Wait for the app to build. Keep an eye on the terminal for any errors.

## Launch the App

Expand Down
1 change: 1 addition & 0 deletions docker-compose-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ services:
AWS_SECRET_ACCESS_KEY: ${filebase_secret_access_key}
FILEBASE_BUCKET: ${filebase_bucket}
YOTI_CLIENT_ID: ${yoti_client_id}
RATE_LIMIT_MINUTE: ${rate_limit_minute}
ports:
- 3000:3000
- 5000:5000
Expand Down
1 change: 1 addition & 0 deletions docker-compose-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ services:
AWS_SECRET_ACCESS_KEY: ${filebase_secret_access_key}
FILEBASE_BUCKET: ${filebase_bucket}
YOTI_CLIENT_ID: ${yoti_client_id}
RATE_LIMIT_MINUTE: ${rate_limit_minute}
ports:
- 3000:3000
- 5000:5000
Expand Down
1 change: 1 addition & 0 deletions docker-compose.local-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ services:
AWS_SECRET_ACCESS_KEY: ${filebase_secret_access_key}
FILEBASE_BUCKET: ${filebase_bucket}
YOTI_CLIENT_ID: ${yoti_client_id}
RATE_LIMIT_MINUTE: ${rate_limit_minute}
ports:
- 3000:3000
- 5000:5000
Expand Down
1 change: 1 addition & 0 deletions docker-compose.local-ssl-with_certbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ services:
AWS_SECRET_ACCESS_KEY: ${filebase_secret_access_key}
FILEBASE_BUCKET: ${filebase_bucket}
YOTI_CLIENT_ID: ${yoti_client_id}
RATE_LIMIT_MINUTE: ${rate_limit_minute}
ports:
- 3000:3000
- 5000:5000
Expand Down
1 change: 1 addition & 0 deletions docker-compose.local-ssl-without_certbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ services:
AWS_SECRET_ACCESS_KEY: ${filebase_secret_access_key}
FILEBASE_BUCKET: ${filebase_bucket}
YOTI_CLIENT_ID: ${yoti_client_id}
RATE_LIMIT_MINUTE: ${rate_limit_minute}
ports:
- 3000:3000
- 5000:5000
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ services:
AWS_SECRET_ACCESS_KEY: ${filebase_secret_access_key}
FILEBASE_BUCKET: ${filebase_bucket}
YOTI_CLIENT_ID: ${yoti_client_id}
RATE_LIMIT_MINUTE: ${rate_limit_minute}
ports:
- 3000:3000
- 5000:5000
Expand Down
1 change: 1 addition & 0 deletions rair-front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@emotion/styled": "^11.13.0",
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-brands-svg-icons": "^6.6.0",
"@fortawesome/free-regular-svg-icons": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"@getyoti/react-face-capture": "^2.3.1",
Expand Down
19 changes: 0 additions & 19 deletions rair-front/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ import {
import { detectBlockchain } from './utils/blockchainData';
// import getInformationGoogleAnalytics from './utils/googleAnalytics';
import gtag from './utils/gtag';
import { rFetch } from './utils/rFetch';
// views
import ErrorFallback from './views/ErrorFallback/ErrorFallback';

Expand Down Expand Up @@ -105,7 +104,6 @@ function App() {
const [tabIndexItems, setTabIndexItems] = useState(0);
const [tokenNumber, setTokenNumber] = useState<number | undefined>(undefined);
const navigate = useNavigate();
const [notificationCount, setNotificationCount] = useState<number>(0);

// Redux
const {
Expand Down Expand Up @@ -171,21 +169,6 @@ function App() {
}
}, [dispatch, logoutUser, blockchainSettings]);

const getNotificationsCount = useCallback(async () => {
if (isLoggedIn && currentUserAddress) {
const result = await rFetch(`/api/notifications?onlyUnread=true`);
if (result.success && result.totalCount >= 0) {
setNotificationCount(result.totalCount);
}
} else {
setNotificationCount(0);
}
}, [isLoggedIn, currentUserAddress]);

useEffect(() => {
getNotificationsCount();
}, [getNotificationsCount]);

// gtag

useEffect(() => {
Expand Down Expand Up @@ -306,8 +289,6 @@ function App() {
showAlert={showAlert}
setTabIndexItems={setTabIndexItems}
isAboutPage={isAboutPage}
notificationCount={notificationCount}
getNotificationsCount={getNotificationsCount}
/>
)
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ts-nocheck
import React, { useCallback, useState } from 'react';
import {
faCheck,
Expand Down Expand Up @@ -40,7 +41,8 @@ const MediaItemChange: React.FC<IMediaItemChange> = ({

const closeModal = useCallback(() => {
setModalIsOpen(false);
}, [setModalIsOpen]);
getMediaList();
}, [setModalIsOpen, getMediaList]);

const [titleValue, setTitleValue] = useState<string>(item.title);
const [disabledBtn, setDisabledBtn] = useState<boolean>(false);
Expand Down Expand Up @@ -103,25 +105,13 @@ const MediaItemChange: React.FC<IMediaItemChange> = ({
className="media-item-title">
{textFlag ? (
<div>
<p className="col-12">
{item.title.length > 15
? item.title.slice(0, 6) +
'...' +
item.title.slice(item.title.length - 10, 10)
: item.title}
</p>
<p className="col-12">{item.title}</p>
</div>
) : (
<div>
{!editTitleVideo ? (
<>
<p className="col-12">
{item.title.length > 15
? item.title.slice(0, 6) +
'...' +
item.title.slice(item.title.length - 10, 10)
: item.title}
</p>
<p className="col-12">{item.title}</p>
{newUserStatus ? (
<button
disabled={!newUserStatus}
Expand All @@ -142,7 +132,7 @@ const MediaItemChange: React.FC<IMediaItemChange> = ({
onClick={() => {
openModal();
}}>
<FontAwesomeIcon icon={faPencilAlt} />
<FontAwesomeIcon icon={faPencilAlt} /> Edit
</button>
</span>
</TooltipBox>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ts-nocheck
import React, { useCallback, useEffect, useState } from 'react';
import Modal from 'react-modal';

Expand All @@ -22,9 +23,8 @@ const PopUpChangeVideo: React.FC<IPopUpChangeVideo> = ({
mediaList,
index
}) => {
const { primaryColor, textColor, primaryButtonColor } = useAppSelector(
(store) => store.colors
);
const { primaryColor, textColor, primaryButtonColor, isDarkMode } =
useAppSelector((store) => store.colors);
const { categories } = useAppSelector((store) => store.settings);
const rSwal = useSwal();

Expand All @@ -33,7 +33,7 @@ const PopUpChangeVideo: React.FC<IPopUpChangeVideo> = ({
const [categoryList, setCategoryList] = useState<OptionsType[] | undefined>(
undefined
);
const [itemCategory, setItemCategory] = useState(item.category);
const [itemCategory, setItemCategory] = useState(item.category._id);

const getCategory = useCallback(async () => {
if (categories) {
Expand All @@ -42,7 +42,7 @@ const PopUpChangeVideo: React.FC<IPopUpChangeVideo> = ({
return {
id: item._id,
label: item.name,
value: item.name,
value: item._id,
disabled: false
};
})
Expand All @@ -69,16 +69,12 @@ const PopUpChangeVideo: React.FC<IPopUpChangeVideo> = ({
setMediaList(newMediaList);
closeModal();
} else {
const choiceCategory: any =
categoryList &&
categoryList.find((item: any) => item.value === itemCategory);

setUploadSuccess(true);

const updatedVideo = {
description: desc,
title: title,
category: choiceCategory.id
category: itemCategory
};
try {
const request = await rFetch(`/api/files/update/${item._id}`, {
Expand All @@ -99,14 +95,14 @@ const PopUpChangeVideo: React.FC<IPopUpChangeVideo> = ({
closeModal();
setDesc(item.description);
setTitle(item.title);
setItemCategory(item.category);
setItemCategory(item.category._id);
setUploadSuccess(null);
}
} catch (e) {
closeModal();
setDesc(item.description);
setTitle(item.title);
setItemCategory(item.category);
setItemCategory(item.category._id);
setUploadSuccess(null);
}
}
Expand All @@ -122,7 +118,7 @@ const PopUpChangeVideo: React.FC<IPopUpChangeVideo> = ({
color: textColor
},
labelCSS: {
color: `${primaryColor === 'rhyno' ? 'rgb(41, 41, 41)' : '#fff'}`,
color: textColor,
marginTop: 5,
marginBottom: 5
}
Expand All @@ -133,7 +129,9 @@ const PopUpChangeVideo: React.FC<IPopUpChangeVideo> = ({
zIndex: '1'
},
content: {
background: primaryColor === 'rhyno' ? '#F2F2F2' : '#383637',
background: isDarkMode
? `color-mix(in srgb, ${primaryColor}, #2D2D2D)`
: 'var(--rhyno)',
top: '50%',
left: '50%',
right: 'auto',
Expand Down Expand Up @@ -171,7 +169,7 @@ const PopUpChangeVideo: React.FC<IPopUpChangeVideo> = ({
if (defaultCategory) {
setItemCategory(defaultCategory.value);
} else {
setItemCategory(item.category);
setItemCategory(item.category._id);
}
}
}
Expand All @@ -191,15 +189,15 @@ const PopUpChangeVideo: React.FC<IPopUpChangeVideo> = ({
label="Title"
customClass="form-control input-select-custom-style"
placeholder="Select a description"
// {...selectCommonInfoNFT}
{...selectCommonInfoNFT}
/>
<InputField
getter={desc}
setter={setDesc}
label="Description"
customClass="form-control input-select-custom-style"
placeholder="Select a description"
// {...selectCommonInfoNFT}
{...selectCommonInfoNFT}
/>
<InputSelect
// customClass="form-control input-select-custom-style"
Expand All @@ -211,7 +209,7 @@ const PopUpChangeVideo: React.FC<IPopUpChangeVideo> = ({
{...selectCommonInfoNFT}
/>
<button
onClick={() => updateVideoData()}
onClick={updateVideoData}
disabled={title === '' || desc === '' || itemCategory === ''}
style={{
marginTop: 30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ const UploadedListBox: React.FC<IUploadedListBox> = ({
className="medialist-box"
key={index}
style={{
backgroundColor: `color-mix(in srgb, ${primaryColor}, #888888)`,
backgroundColor: isDarkMode
? `color-mix(in srgb, ${primaryColor}, #888888)`
: 'var(--rhyno)',
color: textColor,
borderRadius: '15px',
marginTop: '20px'
Expand Down
Loading

0 comments on commit 5d7c3e0

Please sign in to comment.