Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsm412 authored Jul 16, 2024
2 parents f3f2e4f + 0f20c43 commit c468288
Show file tree
Hide file tree
Showing 67 changed files with 506 additions and 1,281 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ base_mainnet_rpc=https://base-mainnet.g.alchemy.com/v2/LPVexfumI81FHrSqJyhwpZ9yb
#default image for NFTs that have no metadata
default_product_cover=https://rair.myfilebase.com/ipfs/QmcV94NurwfWVGpXTST1we8uDbYiVQamKe87WEHK6DRzqa
#ipfs configuration - pinata or ipfs
ipfs_service=filebase
ipfs_service=pinata
ipfs_gateway=http://rairipfs:8080/ipfs
ipfs_api=http://rairipfs:5001
#gcp storage configuration
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
# Getting Started
_Building RAIR is a snap! Follow these simple steps and you'll be up and running in no time._

<iframe width="560" height="315" src="https://www.youtube.com/embed/MmH-JmWkhQo?si=YLSNcz7WxQjBlwRO" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

![download video from git](https://github.com/rairprotocol/RAIRsite/blob/main/src/assets/images/rair-install.webm)
![click walkthrough no narration](https://github.com/rairprotocol/RAIRsite/blob/main/src/assets/images/rair-install.webm)

## Clone the RAIR repository

Expand Down
4 changes: 2 additions & 2 deletions rair-front/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# build environment

FROM node:22.4.0 as build
FROM node:21.2.0 as build

WORKDIR /usr/src/minting

Expand All @@ -22,4 +22,4 @@ COPY --from=build /usr/src/minting/nginx/nginx.conf /etc/nginx/conf.d/default.co
EXPOSE 80

# The default parameters to ENTRYPOINT (unless overruled on the command line)
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]
2 changes: 1 addition & 1 deletion rair-front/nginx/nginx.conf.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ server {
}

location /socket.io {
proxy_pass http://rair-node:5000;
proxy_pass http://rair-stream:5002;
client_max_body_size 200000M;
}
}
Expand Down
17 changes: 0 additions & 17 deletions rair-front/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ import ErrorFallback from './views/ErrorFallback/ErrorFallback';

import 'bootstrap/dist/css/bootstrap.min.css';
import './App.css';
import { rFetch } from './utils/rFetch';
/* Track a page view */
// const analytics = getInformationGoogleAnalytics();
// analytics.page();
Expand Down Expand Up @@ -134,7 +133,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 { primaryColor, textColor, backgroundImage, backgroundImageEffect } =
Expand Down Expand Up @@ -196,19 +194,6 @@ function App() {
}
}, [dispatch, logoutUser]);

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

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

// gtag

useEffect(() => {
Expand Down Expand Up @@ -382,8 +367,6 @@ function App() {
selectedChain={correctBlockchain(realChain)}
setTabIndexItems={setTabIndexItems}
isAboutPage={isAboutPage}
notificationCount={notificationCount}
getNotificationsCount={getNotificationsCount}
/>
)
)}
Expand Down
36 changes: 2 additions & 34 deletions rair-front/src/components/Header/MainHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import TalkSalesComponent from './HeaderItems/TalkToSalesComponent/TalkSalesComp

//styles
import './Header.css';
import { rFetch } from '../../utils/rFetch';

const MainHeader: React.FC<IMainHeader> = ({
goHome,
Expand Down Expand Up @@ -71,8 +70,6 @@ const MainHeader: React.FC<IMainHeader> = ({
);

const hotdropsVar = import.meta.env.VITE_TESTNET;
const [realDataNotification, setRealDataNotification] = useState([]);
const [notificationCount, setNotificationCount] = useState<number>(0);

const [textSearch, setTextSearch] = useState<string>('');
const [adminPanel, setAdminPanel] = useState<boolean>(false);
Expand Down Expand Up @@ -125,35 +122,6 @@ const MainHeader: React.FC<IMainHeader> = ({
setTextSearch('');
};

const getNotifications = useCallback(async (pageNum?: number) => {
if(currentUserAddress) {
// const result = await rFetch(`/api/notifications${itemsPerPage && pageNum ? `?itemsPerPage=${itemsPerPage}&pageNum=${pageNum}` : ''}`);
const result = await rFetch(`/api/notifications${`?pageNum=${Number(pageNum)}`}`);

if (result.success) {
setRealDataNotification(result.notifications);
}
}
}, [currentUserAddress]);

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

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


useEffect(() => {
getNotifications(0);
}, [currentUserAddress])

const Highlight = (props) => {
const { filter, str } = props;
if (!filter) return str;
Expand Down Expand Up @@ -238,7 +206,7 @@ const MainHeader: React.FC<IMainHeader> = ({
backgroundColor: primaryColor
}}
type="text"
placeholder="Search..."
placeholder="Search the rairverse..."
onChange={handleChangeText}
value={textSearch}
onClick={() => setIsComponentVisible(true)}
Expand Down Expand Up @@ -446,7 +414,7 @@ const MainHeader: React.FC<IMainHeader> = ({
isSplashPage={isSplashPage}
/>
<div className="social-media">
{currentUserAddress && <PopUpNotification setRealDataNotification={setRealDataNotification} notificationCount={notificationCount} getNotificationsCount={getNotificationsCount} getNotifications={getNotifications} realDataNotification={realDataNotification} />}
{currentUserAddress && <PopUpNotification />}

<AdminPanel
creatorViewsDisabled={creatorViewsDisabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ const Content = styled.div`
min-width: 50px;
max-height: 80%;
max-width: 80%;
box-shadow:
0 3px 6px rgba(0, 0, 0, 0.16),
0 3px 6px rgba(0, 0, 0, 0.23);
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
background-color: white;
border-radius: 2px;
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@ import * as types from './../actionTypes/types';
const addItemFavoriteStart = () =>
({
type: types.ADD_ITEM_FAVORITES_START
}) as const;
} as const);

const addItemFavoriteEnd = () =>
({
type: types.ADD_ITEM_FAVORITES_END
}) as const;
} as const);

const removeItemFavoriteEnd = () =>
({
type: types.REMOVE_ITEM_FAVORITES_END
}) as const;
} as const);

const getCurrentItemSuccess = (item: TTokenData | null) =>
({
type: types.GET_CURRENT_ITEM_SUCCESS,
item
}) as const;
} as const);

const getCurrentItemFalse = () =>
({
type: types.GET_CURRENT_ITEM_FALSE
}) as const;
} as const);

const errorFavorites = () =>
({
type: types.ERROR_FAVORITES
}) as const;
} as const);

export {
addItemFavoriteEnd,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@ const PaginationBox: React.FC<IPaginationBox> = ({
changePage,
currentPage,
totalPageForPagination,
whatPage,
itemsPerPageNotifications
whatPage
}) => {
const itemsPerPage = useSelector<RootState, number>(
(store) => store.nftDataStore.itemsPerPage
);

console.info(totalPageForPagination, 'totalPageForPagination');
console.info(itemsPerPageNotifications, 'itemsPerPageNotifications')

const { primaryColor, primaryButtonColor } = useSelector<
RootState,
ColorStoreType
Expand All @@ -30,8 +26,6 @@ const PaginationBox: React.FC<IPaginationBox> = ({
const [totalPage, setTotalPages] = useState<number>();
const [totalPageVideo, setTotalPagesVideo] = useState<number>();

console.info(totalPage, 'totalPage')

// const hotdropsVar = import.meta.env.VITE_TESTNET;

const pagesArray: number[] = [];
Expand All @@ -43,10 +37,6 @@ const PaginationBox: React.FC<IPaginationBox> = ({
for (let i = 0; i < totalPageVideo; i++) {
pagesArray.push(i + 1);
}
} else if(whatPage && whatPage === 'notifications' && totalPage) {
for (let i = 0; i < totalPage; i++) {
pagesArray.push(i + 1);
}
}

const getPagesCount = (totalCount: number, itemsPerPage: number) => {
Expand All @@ -66,10 +56,7 @@ const PaginationBox: React.FC<IPaginationBox> = ({
} else if (totalPageForPagination && whatPage === 'video') {
setTotalPagesVideo(getPagesCount(totalPageForPagination, itemsPerPage));
}
else if(totalPageForPagination && whatPage === 'notifications' && itemsPerPageNotifications){
setTotalPages(getPagesCount(totalPageForPagination, itemsPerPageNotifications));
}
}, [setTotalPages, totalPageForPagination, itemsPerPage, whatPage, itemsPerPageNotifications]);
}, [setTotalPages, totalPageForPagination, itemsPerPage, whatPage]);

if (totalPageForPagination === 0) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion rair-front/src/components/MockUpPage/SearchPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ const SearchPanel: React.FC<ISearchPanel> = ({ tabIndex, setTabIndex }) => {
primaryColor === '#dedede' ? 'default' : 'dark'
}`}
className="category-button-nft category-button">
MARKET
{hotdropsVar === 'true' ? 'Collectible' : 'NFT'}
</Tab>
<Tab
onClick={() => {
Expand Down
3 changes: 1 addition & 2 deletions rair-front/src/components/MockUpPage/mockupPage.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ export interface ISvgLock {
color: string;
}

export type TWhatPage = 'nft' | 'video' | 'notifications';
export type TWhatPage = 'nft' | 'video';

export interface IPaginationBox {
changePage: (currentPage: number) => void;
currentPage: number;
totalPageForPagination: number | undefined;
whatPage: TWhatPage;
itemsPerPageNotifications?: number;
}

export interface ILikeButton {
Expand Down
Loading

0 comments on commit c468288

Please sign in to comment.