Skip to content

887-refactor: Partners refactor #892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
61 changes: 30 additions & 31 deletions src/widgets/partnered/partnered.scss
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
.partnered {
&.content {
.partnered-content {
display: flex;
flex-direction: column;

.title {
font-size: 36px;
font-weight: $font-weight-medium;
line-height: 44px;
color: $color-black;
letter-spacing: 0;
}

.partners {
display: flex;
flex-direction: column;
flex-flow: row wrap;
align-items: center;
align-self: center;
justify-content: space-between;

& .title {
font-size: 36px;
font-weight: $font-weight-medium;
line-height: 44px;
color: $color-black;
letter-spacing: 0;
}
width: 100%;
max-width: 500px;
padding: 16px;

& .partners {
.partner-logo-container {
display: flex;
flex-flow: row wrap;
flex-basis: 20%;
align-items: center;
align-self: center;
justify-content: space-between;
justify-content: center;

width: 100%;
max-width: 500px;
padding: 16px;

.partner-logo-container {
display: flex;
flex-basis: 20%;
align-items: center;
justify-content: center;

@include media-tablet {
flex-basis: 50%;
}
@include media-mobile {
flex-basis: 50%;
padding: 24px 0;
}
}

@include media-tablet {
row-gap: 16px;
padding: 16px 0;
}
@include media-tablet {
row-gap: 16px;
padding: 16px 0;
}
}
}
2 changes: 1 addition & 1 deletion src/widgets/partnered/partnered.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render } from '@testing-library/react';
import { describe, expect, it } from 'vitest';

import { Partnered } from '.';
import { Partnered } from './partnered';

describe('Partnered', () => {
it('should render Partnered component', () => {
Expand Down
31 changes: 18 additions & 13 deletions src/widgets/partnered/partnered.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
import classNames from 'classnames/bind';

import { AwsLogo, GithubLogo, JetBrainsLogo } from '@/shared/icons';
import { WidgetTitle } from '@/shared/ui/widget-title';

import './partnered.scss';
// import styles from './partnered.module.scss';
const styles = {};

const cx = classNames.bind(styles);

export const Partnered = () => (
<div className="partnered container" data-testid="partnered">
<div className="partnered content">
<section className={cx('partnered-container', 'container')} data-testid="partnered">
<article className={cx('partnered-content', 'content')}>
<WidgetTitle size="small">Partnered with</WidgetTitle>
<div className="partners">
<div className="partner-logo-container">
<ul className={cx('partners')}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we use the structure like in Alumni widget?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I understand a point of keeping a similar HTML structure in all our widgets

Difference for now:

Alumni

<article>
  <section>
    <WidgetTitle />
    <Paragraph />
    <section>
      {alumni.map(() => (
        <figure>
          <Image />
        </figure>
      ))}
    </section>
  </section>
</article>

Partnered

<section>
  <div>
    <WidgetTitle />
    <ul>
      {partners.map(() => (
        <li>
          <Component />
        </li>
      ))}
    </ul>
  </div>
</section>
  • All containers in widgets have section tag.
  • I't strange to have article->section->section structure
  • lists usually use ul->li tags

Therefore, I suggest to keep partnered html structure in both partnered and alumni widgets

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ansivgit, what do you think?

<li className={cx('partner-logo-container')}>
<JetBrainsLogo />
</div>
<div className="partner-logo-container">
</li>
<li className={cx('partner-logo-container')}>
<AwsLogo />
</div>
<div className="partner-logo-container">
</li>
<li className={cx('partner-logo-container')}>
<GithubLogo />
</div>
</div>
</div>
</div>
</li>
</ul>
</article>
</section>
);
Loading