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

Public Marketplace fixes #427

Merged
merged 4 commits into from
Jun 20, 2023
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
10 changes: 7 additions & 3 deletions gui/pages/Content/Marketplace/Market.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -444,15 +444,16 @@
}

.vertical_line{
width: 0px;
width: 0;
height: 20px;
border: 1px solid rgba(255, 255, 255, 0.1);
flex: none;
margin-left:8px;
}

.topbar_heading{
font-style: normal;
font-weight: 300;
font-weight: 500;
font-size: 14px;
line-height: 18px;
color: #FFFFFF;
Expand Down Expand Up @@ -481,20 +482,23 @@
color: #888888;
margin-left: 4px;
}

.marketplace_public_button{
display: flex;
justify-content: flex-end;
align-items: center;
width:100%;
padding-right:24px;
padding-right:8px;
}

.marketplace_public_content{
height:92.5vh;
width:99vw;
background: rgba(255, 255, 255, 0.08) ;
margin-left:8px;
border-radius: 8px
}

.marketplace_public_container{
height:6.5vh;
display:flex;
Expand Down
46 changes: 23 additions & 23 deletions gui/pages/Content/Marketplace/MarketplacePublic.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ import Image from "next/image";
import styles from './Market.module.css';
import Market from './Market';

export default function MarketplacePublic() {
function handleSignupClick() {
if (window.location.href.toLowerCase().includes('localhost')) {
window.location.href = '/';
}
else
window.open(`https://app.superagi.com/`, '_self')
export default function MarketplacePublic({env}) {
const handleSignupClick = () => {
if (env === 'PROD') {
window.open(`https://app.superagi.com/`, '_self');
} else {
window.location.href = '/';
}
};

return (
<div style={{height:'100vh',width:'100%'}}>
<div className={styles.marketplace_public_container}>
<div className="superAgiLogo" style={{paddingLeft:'24px'}}><Image width={132} height={24} src="/images/sign-in-logo.svg" alt="super-agi-logo"/>
<div className={styles.vertical_line} />
<div className={styles.topbar_heading}>&nbsp;marketplace</div>
</div>
<div className={styles.marketplace_public_button}>
<button className="primary_button" onClick={handleSignupClick}>Try for free today!</button>
</div>
</div>
<div className={styles.marketplace_public_content}>
<Market />
</div>
</div>
);
return (
<div style={{height:'100vh',width:'100%'}}>
<div className={styles.marketplace_public_container}>
<div className="superAgiLogo" style={{paddingLeft:'15px'}}><Image width={132} height={24} src="/images/sign-in-logo.svg" alt="super-agi-logo"/>
<div className={styles.vertical_line} />
<div className={styles.topbar_heading}>&nbsp;marketplace</div>
</div>
<div className={styles.marketplace_public_button}>
<button className="primary_button" onClick={handleSignupClick}>Try for free today!</button>
</div>
</div>
<div className={styles.marketplace_public_content}>
<Market/>
</div>
</div>
);
};


12 changes: 5 additions & 7 deletions gui/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default function App() {
}

useEffect(() => {
if(window.location.href.toLowerCase().includes('marketplace')) {
setShowMarketplace(true);
}

loadingTextEffect('Initializing SuperAGI', setLoadingText, 500);

checkEnvironment()
Expand Down Expand Up @@ -104,12 +108,6 @@ export default function App() {
setApplicationState("AUTHENTICATED");
}
}, [selectedProject]);

useEffect(() => {
if(window.location.href.toLowerCase().includes('marketplace')) {
setShowMarketplace(true)
}
}, []);

const handleSelectionEvent = (data) => {
setSelectedView(data);
Expand All @@ -129,7 +127,7 @@ export default function App() {
{/* eslint-disable-next-line @next/next/no-page-custom-font */}
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet"/>
</Head>
{showMarketplace && <div className="projectStyle"> <MarketplacePublic /> </div>}
{showMarketplace && <div className="projectStyle"> <MarketplacePublic env={env} /> </div>}
{applicationState === 'AUTHENTICATED' && !showMarketplace ? ( <div className="projectStyle">
<div className="sideBarStyle">
<SideBar onSelectEvent={handleSelectionEvent}/>
Expand Down