Skip to content
Open
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
16 changes: 8 additions & 8 deletions firebaseFunctions.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const { join } = require('path')
const { https } = require('firebase-functions')
const { default: next } = require('next')
const { join } = require("path");
const { https } = require("firebase-functions");
const { default: next } = require("next");

const nextjsDistDir = join('src', require('./src/next.config.js').distDir)
const nextjsDistDir = join("src", require("./src/next.config.js").distDir);

const nextjsServer = next({
dev: false,
conf: {
distDir: nextjsDistDir,
},
})
const nextjsHandle = nextjsServer.getRequestHandler()
});
const nextjsHandle = nextjsServer.getRequestHandler();

exports.nextjsFunc = https.onRequest((req, res) => {
return nextjsServer.prepare().then(() => nextjsHandle(req, res))
})
return nextjsServer.prepare().then(() => nextjsHandle(req, res));
});
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.11.2",
"@mui/styles": "^5.0.1",
"@types/react-dom": "^17.0.11",
"firebase": "^8.9.1",
"firebase-admin": "^9.4.2",
"firebase-functions": "^3.13.1",
Expand All @@ -27,12 +28,16 @@
"react-select": "^4.3.1",
"recoil": "^0.4.1",
"styled-components": "^5.3.0",
"swiper": "^6.8.2"
"swiper": "^6.8.2",
"yarn": "^1.22.17"
},
"devDependencies": {
"@types/node": "^16.11.12",
"@types/react": "^17.0.37",
"babel-plugin-styled-components": "^1.13.3",
"firebase-functions-test": "^0.2.3",
"firebase-tools": "^9.3.0"
"firebase-tools": "^9.3.0",
"typescript": "^4.5.3"
},
"license": "MIT",
"volta": {
Expand Down
Empty file removed src/Auth.jsx
Empty file.
11 changes: 11 additions & 0 deletions src/Auth.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'

function Auth() {
return (
<div>

</div>
)
}

export default Auth
31 changes: 31 additions & 0 deletions src/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,34 @@ const App = ({ Component, pageProps }) => {
};

export default App;

// import React from 'react'
// import { AppProps } from 'next/app'
// import Head from 'next/head'
// import { CssBaseline } from '@material-ui/core'
// import { ThemeProvider } from '@material-ui/core/styles'
// import theme from './theme'

// export default function MyApp({ Component, pageProps }: AppProps): JSX.Element {
// React.useEffect(() => {
// // Remove the server-side injected CSS.
// const jssStyles = document.querySelector('#jss-server-side')
// jssStyles?.parentElement?.removeChild(jssStyles)
// }, [])

// return (
// <>
// <Head>
// <title>MyApp</title>
// <meta
// name="viewport"
// content="minimum-scale=1, initial-scale=1, width=device-width"
// />
// </Head>
// <ThemeProvider theme={theme}>
// <CssBaseline />
// <Component {...pageProps} />
// </ThemeProvider>
// </>
// )
// }
2 changes: 1 addition & 1 deletion src/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Document, {
DocumentInitialProps,
} from "next/document";
import createEmotionServer from "@emotion/server/create-instance";
import theme from "../src/theme";
import theme from "./theme";
import createEmotionCache from "../src/createEmotionCache";
import { ServerStyleSheet } from "styled-components";

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Footer.jsx → src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Typography,
} from "@material-ui/core";

const Header = ({ pathname }) => (
const Header = ({ pathname }:{pathname?:any}) => (
<FOoter>
<APpBar position="static">
<Toolbar>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.jsx → src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { auth, db } from "../firebase";
import { useRecoilState } from "recoil";
import { userState } from "../store/userState";

export default function Header({ pathname }) {
export default function Header({ pathname }:{pathname?:any}) {
const [anchorElCompany, setAnchorElCompany] = useState(null);
const [anchorElStudent, setAnchorElStudent] = useState(null);
const [logInUser, setLogInUser] = useRecoilState(userState);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions src/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ const useStyles = makeStyles((theme) => ({
export default function CompanyBusinesses() {
const [business, setBusiness] = useState("");
const [detail, setDetail] = useState("");
const [reward, setReward] = useState();
const [reward, setReward] = useState<number>(0);
const [number, setNumber] = useState("");
const [location, setLocation] = useState("");
const [skill, setSkill] = useState("");
const [skill, setSkill] = useState<any>("");
const [message, setMessage] = useState("");
const [image, setImage] = useState([]);
const [image, setImage] = useState<any>([]);
const [fileUrl, setFileUrl] = useState();
const [applyStatus, setApplyStatus] = useState("");
const router = useRouter();
Expand Down Expand Up @@ -112,7 +112,7 @@ export default function CompanyBusinesses() {
alert("募集をかけました");
setBusiness("");
setDetail("");
setReward("");
setReward(0);
setNumber("");
setLocation("");
setSkill("");
Expand Down Expand Up @@ -196,7 +196,9 @@ export default function CompanyBusinesses() {
<br />
</form>

<Button variant="contained" color="label">
<Button variant="contained"
// color="label"
>
<input type="file" onChange={handleImage} />
</Button>
<br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export default function business() {
const router = useRouter();
const isReady = router.isReady;
const [loading, setLoading] = useState(false);
const [businessInfo, setBusinessInfo] = useState([]);
const [businessInfo, setBusinessInfo] = useState<any>([]);
const [businessImageUrl, setBusinessImageUrl] = useState();
const [businessStatus, setBusinessStatus] = useState("募集中");
const [logInUser, setLogInUser] = useState();
const [logInUser, setLogInUser] = useState<string>();
const [isApplied, setIsApplied] = useState(false);
const [open, setOpen] = React.useState(false);
const [studentId, setStudentId] = useState([]);
Expand All @@ -34,12 +34,14 @@ export default function business() {
setOpen(false);
};

const queryBusiness:any = router.query.business

const getBusinessInformation = async () => {
const info = await db
.collection("Businesses")
.doc(router.query.business)
.doc(queryBusiness)
.get();
setBusinessInfo(info.data());
setBusinessInfo(info.data() as any);
};

const checkExistWhichCollection = async () => {
Expand Down Expand Up @@ -81,7 +83,7 @@ export default function business() {
};

const changeBusinessStatus = (e) => {
db.collection("Businesses").doc(router.query.business).set(
db.collection("Businesses").doc(queryBusiness).set(
{
applyStatus: businessStatus,
},
Expand All @@ -93,7 +95,7 @@ export default function business() {
const applyWork = async () => {
const appliedData = await db
.collection("Businesses")
.doc(router.query.business)
.doc(queryBusiness)
.collection("isApplied")
.where("studentId", "==", auth.currentUser.uid)
.get();
Expand All @@ -102,7 +104,7 @@ export default function business() {
if (zeroOrOne === 0) {
await db
.collection("Businesses")
.doc(router.query.business)
.doc(queryBusiness)
.collection("isApplied")
.doc(auth.currentUser.uid)
.set(
Expand All @@ -117,7 +119,7 @@ export default function business() {
.collection("Students")
.doc(auth.currentUser.uid)
.collection("apply")
.doc(router.query.business)
.doc(queryBusiness)
.set(
{
businessId: router.query.business,
Expand Down Expand Up @@ -150,7 +152,7 @@ export default function business() {
setOpen(true);
const studentId = await db
.collection("Businesses")
.doc(router.query.business)
.doc(queryBusiness)
.collection("isApplied")
.get();
const _studentId = [];
Expand Down Expand Up @@ -178,7 +180,9 @@ export default function business() {
<Loading />
) : (
<>
<td colSpan="2">
<td
colSpan={2}
>
{businessInfo.imageURL && (
<Image
src={businessInfo.imageURL}
Expand Down Expand Up @@ -230,7 +234,9 @@ export default function business() {
""
) : businessInfo.companyId === auth.currentUser.uid ? (
<>
<FormControl sx={{ m: 1, minWidth: 120 }}>
<FormControl
// sx={{ m: 1, minWidth: 120 }}
>
<InputLabel id="demo-simple-select-helper-label">
募集状況
</InputLabel>
Expand Down Expand Up @@ -273,7 +279,7 @@ export default function business() {
>
<Box
sx={{ ...style, width: 400 }}
variant="contained"
// variant="contained"
color="primary"
>
{studentId.map((student, index) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export default function company() {
const router = useRouter();
const isReady = router.isReady;
const [loading, setLoading] = useState(false);
const [companyInfo, setCompanyInfo] = useState();
const [companyBusinessInfo, setCompanyBusinessInfo] = useState();
const [companyInfo, setCompanyInfo] = useState<any>();
const [companyBusinessInfo, setCompanyBusinessInfo] = useState<any>();
const [companyBusinessImageUrl, setCompanyBusinessImageUrl] = useState([]);
// const [exists, setExists] = useState(false);
const [open, setOpen] = React.useState(false);
Expand All @@ -44,17 +44,19 @@ export default function company() {
p: 4,
};

const queryCompany:any = router.query.company

const getCompanyInformation = async () => {
const info = await db
.collection("Companies")
.doc(router.query.company)
.doc(queryCompany)
.get();
setCompanyInfo(info.data());
setCompanyInfo(info.data() as any);
};

const getCompanyBusinessInformation = async () => {
const _companyBusinessInfo = [];
const _businessInfoWithSub = [];
const _businessInfoWithSub:any = [];

const businessInfo = await db
.collection("Businesses")
Expand Down Expand Up @@ -200,15 +202,21 @@ export default function company() {
>
{business.business}
</Typography>
<Typography variant="body2" color="text.secondary">
<Typography variant="body2"
// color="text.secondary"
>
{business.message}
</Typography>
<br />
<Typography variant="body2" color="text.secondary">
<Typography variant="body2"
// color="text.secondary"
>
{business.location}
</Typography>
<br />
<Typography variant="body2" color="text.secondary">
<Typography variant="body2"
// color="text.secondary"
>
{`${business.reward}/月`}
</Typography>
</CardContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,23 @@ export default function student() {
const router = useRouter();
const isReady = router.isReady;
const [loading, setLoading] = useState(false);
const [studentInfo, setStudentInfo] = useState();
const [studentInfo, setStudentInfo] = useState<any>();
const [studentBusinessInfo, setStudentBusinessInfo] = useState([]);

const queryStudent:any = router.query.student

const getStudentInformation = async () => {
const info = await db
.collection("Students")
.doc(router.query.student)
.doc(queryStudent)
.get();
setStudentInfo(info.data());
setStudentInfo(info.data()as any);
};

const getStudentAppliedBusinessData = async () => {
const appliedBusinessInfo = await db
.collection("Students")
.doc(router.query.student)
.doc(queryStudent)
.collection("apply")
.get();
const _appliedBusinessInfo = [];
Expand Down
2 changes: 1 addition & 1 deletion src/store/userState.js → src/store/userState.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { atom } from "recoil";

export const userState = atom({
export const userState = atom<any>({
key: "userState",
default: { uid: "" },
});
Loading