Skip to content

Commit

Permalink
update: startup-directory about, account change styles, sign in / reg…
Browse files Browse the repository at this point in the history
…ister
  • Loading branch information
daviskeene committed Apr 3, 2023
1 parent 5aa726a commit 6b4df83
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 23 deletions.
27 changes: 21 additions & 6 deletions app/components/Form.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import router from 'next/router';
import React from 'react';
import React, { useEffect } from 'react';
import JSONSchemaForm from 'react-jsonschema-form';
import { STAGES, CATEGORIES, SIZES, RESOURCES } from '../utils/constants';

Expand Down Expand Up @@ -126,10 +126,11 @@ const uiSchema = {
},
};

export default function Form({ onSubmit, account }) {
export default function Form({ onSubmit, account, isOnboarding }) {
const [isLoading, setIsLoading] = React.useState(true);
const [schema, setSchema] = React.useState(postSchema);
const [buttonText, setButtonText] = React.useState('Save Changes');
const [buttonText, setButtonText] = React.useState(isOnboarding ? 'Submit' : 'Save Changes');
const [submitButtonDisabled, setSubmitButtonDisabled] = React.useState(false);

React.useEffect(() => {
(async function () {
Expand All @@ -150,6 +151,9 @@ export default function Form({ onSubmit, account }) {
if (key === 'categories') {
upstream = upstream[0];
}
if (key === 'resources') {
upstream = upstream[0];
}
newSchema.properties[key].default = upstream;
}
}
Expand All @@ -174,14 +178,25 @@ export default function Form({ onSubmit, account }) {
return (
<div className="container">
<div className="col-md-offset-8 col-md-7">
<JSONSchemaForm onSubmit={onSubmit} schema={schema} uiSchema={uiSchema}>
<div style={{ display: 'flex' }}>
<button type="submit" className={'btn btn-info btn-add'}>
<JSONSchemaForm onSubmit={async (e) => {
const resp = await onSubmit(e);
if (resp.success) {
// Make sure user knows their changes went through
setButtonText('Success!');
setSubmitButtonDisabled(true);
} else {
setButtonText('Error on form submit!');
setButtonText('Save Changes');
}
}} schema={schema} uiSchema={uiSchema}>
<div style={{ display: 'flex', marginTop: '24px', marginBottom: '12px' }}>
<button style={{ margin: '0 12px', ...submitButtonDisabled && { color: 'lightgray', backgroundColor: 'white', border: 'none'}}} type="submit" className={'btn btn-info btn-add'} disabled={submitButtonDisabled}>
{buttonText}
</button>
<button
type="button"
className={'btn btn-info btn-delete'}
style={{ margin: '0 12px'}}
onClick={() => {
if (confirm('Are you sure you want to delete this org?')) {
fetch(`/api/organizations/${account.orgId}`, {
Expand Down
2 changes: 1 addition & 1 deletion app/components/Nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Nav = () => {
{!user && (
<li>
<Link href="/api/auth/login" activeClassName="active-link" exact>
Sign In
Sign In / Register
</Link>
</li>
)}
Expand Down
13 changes: 2 additions & 11 deletions app/components/accounts/Onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default function Onboarding({ user }) {
} else {
console.error('Post Failed');
}
return json;
};

let content = (
Expand All @@ -47,16 +48,6 @@ export default function Onboarding({ user }) {
</p>
<button onClick={() => setStage(STAGES.CREATION)}>Create A Page</button>
</div>
<div>
<h2>Already on the directory?</h2>
<p>
If your company has already been listed on the directory click below
to join your organization as a team member.
</p>
<button onClick={() => setStage(STAGES.JOINING)}>
Join Your Teammates
</button>
</div>
</div>
);

Expand All @@ -75,7 +66,7 @@ export default function Onboarding({ user }) {
);
break;
case STAGES.CREATION:
content = <Form onSubmit={handleSubmitOrg} />;
content = <Form onSubmit={handleSubmitOrg} isOnboarding />;
default:
break;
}
Expand Down
9 changes: 6 additions & 3 deletions app/content/about.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Founders - Illinois Entrepreneurs is a student organization at UIUC that's dedicated to creating a community of continuous innovation and entrepreneurship. As part of our mission statement, we want to be able to increase the visibility into the startup community. There's currently no way for people to examing the
entrepreneurship community and explore all of the startups that exist at UIUC. That is, until now.
The Startup Directory is an online platform where startups on campus can register and showcase information about their business for the world to see. This platform provides an opportunity for entrepreneurs to increase their visibility and attract potential investors, mentors, and customers. Moreover, it also helps to promote collaboration and networking among startups on campus.

The Startup Directory is Founders' attempt at unifying startups on campus. Startups can register with the directory and upload information about themselves for the world to see. As more and more students attend Founders events and begin creating their own ventures, our directory will contain more information about the greater entrepreneurship community. Click into any of the listed startups to learn more about them.
As more and more students attend Founders events and start their own ventures, the directory will continue to grow and evolve, providing an increasingly comprehensive and dynamic view of the entrepreneurship community at UIUC. Visitors can click into any of the listed startups to learn more about them, including their vision, mission, team, and progress.

Overall, the Startup Directory is an excellent resource for anyone interested in entrepreneurship at UIUC. It is an excellent example of how student organizations can leverage technology to create a thriving community of innovation and entrepreneurship on campus.

**Founders - Illinois Entrepreneurs is a vibrant student organization at the University of Illinois at Urbana-Champaign (UIUC) that is passionate about creating a community of innovation and entrepreneurship. With a keen focus on continuous growth and development, the group aims to support and nurture budding entrepreneurs on campus, providing them with the necessary tools, resources, and guidance to turn their ideas into successful businesses.**
5 changes: 3 additions & 2 deletions app/pages/account/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ import { withPageAuthRequired } from '@auth0/nextjs-auth0';
import Onboarding from '../../components/accounts/Onboarding';
import Layout from '../../components/Layout';

function Account() {
function Account({ isOnboarding }) {
const { user } = useUser();
const { account } = React.useContext(AccountContext);

const handleFormSubmit = async (submission) => {
const { formData: data } = submission;
await fetch('/api/accounts/org', {
const resp = await fetch('/api/accounts/org', {
method: 'PATCH',
body: JSON.stringify({ ...data, email: account.email }),
});
return resp.json();
};

let content = (
Expand Down
2 changes: 2 additions & 0 deletions app/styles/Account.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
justify-content: center;
align-items: stretch;
flex-direction: column;
margin: auto;
width: 80%;
}

.actionGrid button {
Expand Down
4 changes: 4 additions & 0 deletions app/styles/Footer.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@
color: textColor;
opacity: 0.6;
background-color: pureWhiteColor;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
}
1 change: 1 addition & 0 deletions app/styles/Form.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
display: flex;
justify-content: center;
align-items: center;
padding: 24px;
}

.filterBox {
Expand Down
1 change: 1 addition & 0 deletions app/styles/Layout.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
width: 95%;
max-width: 1200px;
margin: 0 auto;
padding-bottom: 24px;
}

.main {
Expand Down
1 change: 1 addition & 0 deletions app/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const SIZES = Object.freeze([

/** @constant {Array<string>} */
export const RESOURCES = Object.freeze([
'',
'TEC',
'iVenture',
'Zero2One',
Expand Down

1 comment on commit 6b4df83

@vercel
Copy link

@vercel vercel bot commented on 6b4df83 Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.