Skip to content

Commit

Permalink
🐛 Fix: Bad UI Issues in Profile Section (#1025)
Browse files Browse the repository at this point in the history
* Removed Github Repository Links Section

Signed-off-by: Vividh Pandey <[email protected]>

* Fixed overlay of tribes section

Signed-off-by: Vividh Pandey <[email protected]>

* Fixed: pretext and input text to be on same y-axis

Signed-off-by: Vividh Pandey <[email protected]>

* Fixed default width of form components

Signed-off-by: Vividh Pandey <[email protected]>

* Fixed Github Repository Links Area

also changed the type to text

* Commented Validator temporarily

* Update interfaces.ts

* Update schema.ts

* Update AboutFocusView.tsx

* Update AboutView.tsx

* Update schema.ts

* Prettier ReRun

Signed-off-by: Vividh Pandey <[email protected]>

* Fixed Prepend Text for text inputs

Signed-off-by: Vividh Pandey <[email protected]>

* Fixed Prettier Checks

Signed-off-by: Vividh Pandey <[email protected]>

---------

Signed-off-by: Vividh Pandey <[email protected]>
  • Loading branch information
VividhPandey003 authored Dec 5, 2023
1 parent 5c0c13e commit 12bd3e4
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 47 deletions.
17 changes: 13 additions & 4 deletions frontend/app/src/components/form/inputs/MultiSelectInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useState } from 'react';
import styled from 'styled-components';
import { EuiIcon } from '@elastic/eui';
import { MultiSelect } from '../../common';
Expand All @@ -12,7 +12,7 @@ interface styledProps {

const ExtraText = styled.div`
padding: 2px 10px 25px 10px;
max-width: calc(100% - 20px);
max-width: calc(100 % - 20px);
word-break: break-all;
font-size: 14px;
`;
Expand All @@ -25,7 +25,7 @@ const E = styled.div<styledProps>`
height: 100%;
justify-content: center;
align-items: center;
color: ${(p: any) => p.color && p.color.blue3};
color: ${(p: any) => p?.color && p.color.blue3};
pointer-events: none;
user-select: none;
`;
Expand All @@ -46,9 +46,16 @@ export default function MultiSelectInput({
if (error) labeltext = `${labeltext} (${error})`;
const color = colors['light'];

const [isTop, setIsTop] = useState<boolean>(false);

return (
<>
<FieldEnv label={labeltext} color={color}>
<FieldEnv
color={color}
label={labeltext}
isTop={isTop || value?.length > 0}
isFill={value?.length > 0}
>
<R>
<MultiSelect
selectStyle={{ border: 'none' }}
Expand All @@ -57,7 +64,9 @@ export default function MultiSelectInput({
value={value}
onChange={(e: any) => {
handleChange(e);
setIsTop(true);
}}
setIsTop={setIsTop}
/>
{error && (
<E color={color}>
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/src/components/form/inputs/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default function TextInput({
handleFocus(e);
setActive(true);
}}
prepend={prepend}
prepend={active ? prepend : ''}
style={padStyle}
isTextField={true}
/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/src/components/form/inputs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const FieldText = styled(EuiFieldText)<styledProps>`
p.readOnly ? `${p.color.grayish.G60A}` : `${p.color.pureBlack}`} !important;
box-shadow: none !important;
height: ${(p: any) => (p?.isTextField ? '12px' : '')};
margin-top: ${(p: any) => (p?.isTextField ? '2px' : '')};
margin-top: ${(p: any) => (p?.isTextField ? '8px' : '')};
.euiFormRow__labelWrapper .euiFormControlLayout--group {
background-color: ${(p: any) => p?.color && p.color.pureWhite} !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export interface Extras {
github?: [{ [key: string]: string }];
coding_languages?: [{ [key: string]: string }];
tribes?: [{ [key: string]: string }];
repos?: [{ [key: string]: string }];
lightning?: [{ [key: string]: string }];
amboss?: [{ [key: string]: string }];
}
Expand Down
19 changes: 0 additions & 19 deletions frontend/app/src/components/form/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ import { FormField } from './utils';

const strValidator = Yup.string().trim().required('Required');
const strValidatorNotRequired = Yup.string().trim();
const repoStrValidator = Yup.string()
.trim()
.matches(/^[^/]+\/[^/]+$/, 'Incorrect format')
.required('Required');
const repoArrayStrValidator = Yup.array().of(
Yup.object().shape({
value: repoStrValidator
})
);
const badgeObjectStrValidator = Yup.object().shape({
value: strValidator
});
Expand Down Expand Up @@ -434,16 +425,6 @@ export const aboutSchema: FormField[] = [
prepend: 'https://github.com/',
page: 1
},
{
name: 'repos',
label: 'Github Repository Links',
widget: true,
type: 'creatablemultiselect',
options: [],
note: 'Enter in this format: ownerName/repoName, (e.g. stakwork/sphinx-tribes).',
validator: repoArrayStrValidator, // look for 1 slash
page: 1
},
{
name: 'lightning',
label: 'Lightning address',
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/src/components/form/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const Wrap = styled.div<WrapProps>`
height: inherit;
flex-direction: column;
align-content: center;
min-width: 230px;
min-width: 600px;
`;

export const OrgWrap = styled.div<WrapProps>`
Expand Down
1 change: 0 additions & 1 deletion frontend/app/src/people/main/AboutFocusView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ const AboutFocusView = (props: FocusViewProps) => {
// extras with multiple items
initialValues.coding_languages = personInfo.extras?.coding_languages || [];
initialValues.tribes = personInfo.extras?.tribes || [];
initialValues.repos = personInfo.extras?.repos || [];
initialValues.lightning =
(personInfo.extras?.lightning && personInfo.extras?.lightning[0]?.value) || '';
initialValues.amboss =
Expand Down
20 changes: 1 addition & 19 deletions frontend/app/src/people/widgetViews/AboutView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ const Img = styled.div<ImageProps>`
export const AboutView = observer((props: AboutViewProps) => {
const history = useHistory();
const { price_to_meet, extras, twitter_confirmed, owner_pubkey, owner_route_hint } = props;
const { twitter, github, coding_languages, tribes, repos, lightning, amboss, email } =
extras || {};
const { twitter, github, coding_languages, tribes, lightning, amboss, email } = extras || {};

let tag = '';
let githubTag = '';
Expand Down Expand Up @@ -321,23 +320,6 @@ export const AboutView = observer((props: AboutViewProps) => {
</>
)}

{repos && repos.length > 0 && (
<>
<Divider />
<T style={{ height: 20 }}>My Repos</T>
<Grow>
{repos.map((r: any, i: number) => (
<ItemRow key={`${i}myrepo`} style={{ width: 'fit-content' }}>
<Img src={'/static/github_logo.png'} style={{ opacity: 0.6 }} />
<a href={`https://github.com/${r?.label}`} target="_blank" rel="noreferrer">
{r?.label}
</a>
</ItemRow>
))}
</Grow>
</>
)}

{tribes && tribes.length > 0 && (
<>
<Divider />
Expand Down

0 comments on commit 12bd3e4

Please sign in to comment.