Skip to content

Commit 733daa3

Browse files
authored
Merge pull request #8 from purshink/master
mobile dev opt
2 parents 772f130 + 5681563 commit 733daa3

26 files changed

+470
-275
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: DEPLOY REACT APP
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push request events but only for the main branch
8+
push:
9+
branches: [ main ]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
inputs:
14+
job_name:
15+
description: "Run Job"
16+
required: true
17+
default: 'build_deploy'
18+
19+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
20+
jobs:
21+
# This workflow contains a single job called "build"
22+
build_deploy:
23+
# The type of runner that the job will run on
24+
runs-on: ubuntu-latest
25+
26+
# Steps represent a sequence of tasks that will be executed as part of the job
27+
steps:
28+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
29+
- uses: actions/checkout@v2
30+
31+
# Runs a single command using the runners shell
32+
- name: Npm Install Packages
33+
run: npm install
34+
35+
- name: Test and Code Coverage
36+
run: npm test -- --coverage
37+
38+
- name: Upload Code Coverage
39+
uses: codecov/codecov-action@v1
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
43+
- name: Build Package
44+
env:
45+
CI: false
46+
run: npm run build

Hobbie_fullstack/react-frontend/src/App.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
font-family: "Poppins", sans-serif;
55
border: 1px solid transparent;
66
padding-bottom: 20px;
7-
height: 100%;
87
}
98
#root {
109
height: 100%;
@@ -36,7 +35,7 @@ h3 {
3635
}
3736

3837
form {
39-
width: 50%;
38+
/* width: 50%; */
4039
border: none;
4140
margin-top: 20px;
4241
}

Hobbie_fullstack/react-frontend/src/components/root/home/Home.jsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@ import React from "react";
22
import BackgroundCover from "./BackgroundCover";
33
import Presentation from "./Presentation";
44
import Cover from "./Cover";
5-
import Footer from "../fragments/footer/Footer";
5+
import Footer from "../fragments/footer/Footer";
66
import style from "../../../css/Footer.module.css";
77

88
const Home = () => {
99
return (
10-
<main>
11-
<Presentation />
12-
<Cover />
13-
<Footer class={style.footer_cover}/>
14-
<BackgroundCover />
15-
</main>
10+
<>
11+
<main>
12+
<Presentation />
13+
<Cover />
14+
<BackgroundCover />
15+
</main>
16+
<Footer class={style.footer_cover} />
17+
</>
1618
);
1719
};
1820

Hobbie_fullstack/react-frontend/src/components/root/users/UsersHome.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const UserHome = () => {
102102
<div className={styles.intro_text}>
103103
{isUserLoggedIn && (
104104
<div>
105-
<p>You have no hobby matches.</p>
105+
<p className={styles.intro}>You have no hobby matches.</p>
106106
<div className={styles.buttuns}>
107107
<button className={styles.link}>
108108
<Link to="/test" className={styles.btn}>
@@ -114,7 +114,7 @@ const UserHome = () => {
114114
)}
115115
{isBusinessLoggedIn && (
116116
<div>
117-
<p>You have no hobby offers.</p>
117+
<p className={styles.intro}>You have no hobby offers.</p>
118118
<div className={styles.buttuns}>
119119
<button className={styles.link}>
120120
<Link to="/create-offer" className={styles.btn}>

Hobbie_fullstack/react-frontend/src/components/root/users/business/AccountBusiness/AccountBusiness.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ const AccountBusiness = () => {
9393
onClick={handleDelete(business)}
9494
className={styles.account_btn}
9595
>
96-
Delete profile
96+
Delete
9797
</Link>
9898
<Link
9999
to="#"
100100
onClick={handleEdit(business)}
101101
className={styles.account_btn}
102102
>
103-
Edit profile
103+
Edit
104104
</Link>
105105
</article>
106106
</div>

Hobbie_fullstack/react-frontend/src/components/root/users/business/AccountBusiness/EditBusinessProfile.jsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import UpdateBusinessDataService from "../../../../../api/users/UpdateBusinessDa
77
import styles from "../../../../../css/Forms.module.css";
88
import style from "../../../../../css/Footer.module.css";
99
import { useLocation } from "react-router-dom";
10+
import LoadingDots from "../Offer/animation/LoadingDots";
1011

1112
const EditBusinessProfile = () => {
1213
const navigate = useNavigate();
1314
const location = useLocation();
15+
const [loading, setLoading] = useState(false);
1416

1517
const [error, setError] = useState(false);
1618
const [info, setInfo] = useState({
@@ -56,6 +58,7 @@ const EditBusinessProfile = () => {
5658

5759
if (Object.keys(errors).length === 0) {
5860
console.log(info);
61+
setLoading(true);
5962
await UpdateBusinessDataService(info)
6063
.then((response) => {
6164
if (response.status === 201) {
@@ -145,13 +148,17 @@ const EditBusinessProfile = () => {
145148
</section>
146149

147150
<article className={styles.form_field}>
148-
<button type="submit" className={styles.button}>
149-
Save
150-
</button>
151+
{loading && <LoadingDots />}
152+
153+
{!loading && (
154+
<button type="submit" className={styles.button}>
155+
Save
156+
</button>
157+
)}
151158
</article>
152159
</form>
153160
</main>
154-
<Footer class={style.footer_cover} />
161+
<Footer class={style.footer} />
155162
<Background />
156163
</>
157164
);

Hobbie_fullstack/react-frontend/src/components/root/users/business/Offer/CreateOffer.jsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,14 @@ const CreateOffer = () => {
6060

6161
if (!info.intro) {
6262
errors.intro = "Intro is required";
63-
}
64-
else if (info.intro.length > 900 ) {
65-
errors.intro = "Text has to be maximum 900 characters long"
63+
} else if (info.intro.length > 900) {
64+
errors.intro = "Text has to be maximum 900 characters long";
6665
}
6766

6867
if (!info.description) {
6968
errors.description = "Description is required";
70-
}
71-
else if (info.description.length > 900) {
72-
errors.description = "Text has to be maximum 900 characters long"
69+
} else if (info.description.length > 900) {
70+
errors.description = "Text has to be maximum 900 characters long";
7371
}
7472

7573
if (!info.price) {
@@ -91,9 +89,8 @@ const CreateOffer = () => {
9189

9290
if (!info.contactInfo) {
9391
errors.contactInfo = "Contact info is required";
94-
}
95-
else if (info.contactInfo.length < 20 || info.contactInfo.length > 900) {
96-
errors.contactInfo = "Text has to be between 20 and 900 characters long"
92+
} else if (info.contactInfo.length < 20 || info.contactInfo.length > 900) {
93+
errors.contactInfo = "Text has to be between 20 and 900 characters long";
9794
}
9895
return errors;
9996
};
@@ -228,7 +225,12 @@ const CreateOffer = () => {
228225
label="Intro"
229226
name="intro"
230227
error={errors.intro}
231-
onChange={(e) => setInfo({ ...info, intro: e.target.value.replace(/\n\r?/g, "\n") })}
228+
onChange={(e) =>
229+
setInfo({
230+
...info,
231+
intro: e.target.value.replace(/\n\r?/g, "\n"),
232+
})
233+
}
232234
/>
233235

234236
<OfferTextaria
@@ -355,7 +357,7 @@ const CreateOffer = () => {
355357
</form>
356358
</main>
357359

358-
<Footer class={style.footer_hobbie_details}/>
360+
<Footer class={style.footer_hobbie_details} />
359361
</>
360362
);
361363
};

0 commit comments

Comments
 (0)