Skip to content

Commit 0a9b3c6

Browse files
Merge pull request #387 from topcoder-platform/PROD-1529_page-footer
PROD-1529 page footer -> qa
2 parents 5393081 + c74a520 commit 0a9b3c6

File tree

85 files changed

+2644
-2620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2644
-2620
lines changed

src-ts/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Routes } from 'react-router-dom'
33
import { toast, ToastContainer } from 'react-toastify'
44

55
import { Header } from './header'
6-
import { ProfileProvider, routeContext, RouteContextData } from './lib'
6+
import { routeContext, RouteContextData } from './lib'
77

88
const App: FC<{}> = () => {
99

@@ -13,7 +13,7 @@ const App: FC<{}> = () => {
1313
.map(route => getRouteElement(route))
1414

1515
return (
16-
<ProfileProvider>
16+
<>
1717
<Header />
1818
<Routes>
1919
{routeElements}
@@ -29,7 +29,7 @@ const App: FC<{}> = () => {
2929
draggable
3030
pauseOnHover
3131
/>
32-
</ProfileProvider>
32+
</>
3333
)
3434
}
3535

src-ts/config/constants.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@ export enum ToolTitle {
22
settings = 'Account Settings',
33
work = 'Work',
44
}
5+
6+
export enum FooterSocialConfig {
7+
facebook = 'https://www.facebook.com/topcoder',
8+
youtube = 'https://www.youtube.com/channel/UCFv29ANLT2FQmtvS9DRixNA',
9+
linkedin = 'https://www.linkedin.com/company/topcoder',
10+
twitter = 'https://twitter.com/topcoder',
11+
instagram = 'https://www.instagram.com/topcoder',
12+
}

src-ts/header/Header.module.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
grid-template-columns: 78px 1fr auto;
1717

1818
@include ltemd {
19-
height: $header-height-md;
2019
grid-template-columns: $header-height 1fr $header-height;
2120
align-items: center;
2221
}
2322

2423
@include ltesm {
25-
height: $header-height-sm;
24+
height: $header-height;
2625
}
2726
}
2827

src-ts/header/tool-selectors/tool-selectors-narrow/ToolSelectorsNarrow.module.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,5 @@
2626
z-index: 100;
2727
background-color: $black-100;
2828
padding: $pad-xxl;
29-
30-
@include ltemd {
31-
top: $header-height-md;
32-
}
33-
34-
@include ltesm {
35-
top: $header-height-sm;
36-
}
3729
}
3830
}

src-ts/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
export { default as AppNextGen } from './App'
22
export { EnvironmentConfig } from './config'
33
export {
4-
ChallengeMetadataName,
54
Breadcrumb,
5+
ChallengeMetadataName,
6+
ContactSupportModal,
67
logInitialize,
8+
OrderContractModal,
9+
PageFooter,
10+
PrivacyPolicyModal,
711
ProfileProvider,
812
RouteProvider,
913
TabsNavbar,
14+
TermsModal,
1015
workContext,
1116
WorkStatusItem,
1217
} from './lib'

src-ts/lib/content-layout/ContentLayout.module.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
@import '../styles/';
22

33
.content {
4-
@include content-height;
54
padding-top: 0;
6-
position: relative;
5+
padding-bottom: $pad-lg;
6+
7+
flex: 99 1 auto;
8+
display: flex;
79

810
.content-outer {
911
max-width: $xxl-min;
1012
@include pagePaddings;
1113
margin: 0 auto;
12-
height: 100%;
13-
14+
width: 100%;
15+
display: flex;
1416
.content-inner {
1517
margin: 0 auto;
1618
flex: 1;
1719
max-width: $xxl-min;
1820
display: flex;
1921
flex-direction: column;
2022
overflow: auto;
21-
min-height: 100%;
2223

2324
.page-header {
2425
display: flex;
@@ -35,4 +36,3 @@
3536
}
3637
}
3738
}
38-

src-ts/lib/form/Form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const Form: <ValueType extends any, RequestType extends any>(props: FormProps<Va
6868

6969
async function onSubmitAsync(event: FormEvent<HTMLFormElement>): Promise<void> {
7070
const values: RequestType = props.requestGenerator(formDef.inputs)
71-
formOnSubmitAsync<RequestType>(event, formDef.inputs, props.formDef.shortName || 'data', values, props.save, props.onSuccess)
71+
formOnSubmitAsync<RequestType>(event, formDef, values, props.save, props.onSuccess)
7272
.then(() => {
7373
setFormKey(Date.now())
7474
formOnReset(formDef.inputs, props.formValues)

src-ts/lib/form/form-definition.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface FormDefinition {
66
readonly inputs: ReadonlyArray<FormInputModel>
77
readonly shortName?: string
88
readonly subtitle?: string
9+
readonly successMessage?: string
910
readonly tabIndexStart?: number
1011
readonly title?: string
1112
}

src-ts/lib/form/form-functions/form.functions.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ChangeEvent, FormEvent } from 'react'
22
import { toast } from 'react-toastify'
33

4+
import { FormDefinition } from '../form-definition.model'
45
import { FormInputModel } from '../form-input.model'
56

67
export function getInputElement(formElements: HTMLFormControlsCollection, fieldName: string): HTMLInputElement {
@@ -49,15 +50,16 @@ export function onReset(inputs: ReadonlyArray<FormInputModel>, formValue?: any):
4950

5051
export async function onSubmitAsync<T>(
5152
event: FormEvent<HTMLFormElement>,
52-
inputs: ReadonlyArray<FormInputModel>,
53-
formName: string,
53+
formDef: FormDefinition,
5454
formValue: T,
5555
save: (value: T) => Promise<void>,
5656
onSuccess?: () => void,
5757
): Promise<void> {
5858

5959
event.preventDefault()
6060

61+
const { inputs, shortName, successMessage }: FormDefinition = formDef
62+
6163
// get the dirty fields before we validate b/c validation marks them dirty on submit
6264
const dirty: FormInputModel | undefined = inputs.find(fieldDef => !!fieldDef.dirty)
6365

@@ -79,7 +81,10 @@ export async function onSubmitAsync<T>(
7981

8082
return savePromise
8183
.then(() => {
82-
toast.success(`Your ${formName} has been saved.`)
84+
const safeSuccessMessage: string = !!successMessage
85+
? successMessage as string
86+
: `Your ${shortName || 'data'} has been saved.`
87+
toast.success(safeSuccessMessage)
8388
onSuccess?.()
8489
})
8590
.catch(error => {

src-ts/lib/form/form-inputs/form-input-row/FormInputRow.module.scss

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
@import '../../../../lib/styles';
22

3-
h4 {
4-
border-top: $border-xs solid $black-10;
5-
6-
&.input-title-0 {
7-
border: none;
3+
.row-wrap {
4+
h4 {
5+
border-top: $border-xs solid $black-10;
6+
7+
&.input-title-0 {
8+
border: none;
9+
}
810
}
911
}
1012

0 commit comments

Comments
 (0)