-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ContentCard): rename prop subtitle -> subhead (#7694)
- Loading branch information
1 parent
34dd1ec
commit ccb6246
Showing
21 changed files
with
107 additions
and
35 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
packages/codemods/src/transforms/v7/__testfixtures__/content-card/basic.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { ContentCard } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
|
||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<ContentCard | ||
subtitle="VKUI" | ||
header="ContentCard example" | ||
caption="VKUI Styleguide > Blocks > ContentCard" | ||
/> | ||
<ContentCard | ||
subtitle={"VKUI"} | ||
header="ContentCard example" | ||
caption="VKUI Styleguide > Blocks > ContentCard" | ||
/> | ||
</React.Fragment> | ||
); | ||
}; |
23 changes: 23 additions & 0 deletions
23
packages/codemods/src/transforms/v7/__tests__/__snapshots__/content-card.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`content-card transforms correctly 1`] = ` | ||
"import { ContentCard } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
const App = () => { | ||
return ( | ||
(<React.Fragment> | ||
<ContentCard | ||
subhead="VKUI" | ||
header="ContentCard example" | ||
caption="VKUI Styleguide > Blocks > ContentCard" | ||
/> | ||
<ContentCard | ||
subhead={"VKUI"} | ||
header="ContentCard example" | ||
caption="VKUI Styleguide > Blocks > ContentCard" | ||
/> | ||
</React.Fragment>) | ||
); | ||
};" | ||
`; |
12 changes: 12 additions & 0 deletions
12
packages/codemods/src/transforms/v7/__tests__/content-card.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
jest.autoMockOff(); | ||
|
||
import { defineSnapshotTestFromFixture } from '../../../testHelpers/testHelper'; | ||
|
||
const name = 'content-card'; | ||
const fixtures = ['basic'] as const; | ||
|
||
describe(name, () => { | ||
fixtures.forEach((test) => | ||
defineSnapshotTestFromFixture(__dirname, name, global.TRANSFORM_OPTIONS, `${name}/${test}`), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { API, FileInfo } from 'jscodeshift'; | ||
import { getImportInfo, renameProp } from '../../codemod-helpers'; | ||
import { JSCodeShiftOptions } from '../../types'; | ||
|
||
export const parser = 'tsx'; | ||
|
||
export default function transformer(file: FileInfo, api: API, options: JSCodeShiftOptions) { | ||
const { alias } = options; | ||
const j = api.jscodeshift; | ||
const source = j(file.source); | ||
const { localName } = getImportInfo(j, file, 'ContentCard', alias); | ||
|
||
if (localName) { | ||
renameProp(j, source, localName, { subtitle: 'subhead' }); | ||
} | ||
|
||
return source.toSource(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,6 @@ | |
} | ||
|
||
.caption, | ||
.subtitle { | ||
.subhead { | ||
color: var(--vkui--color_text_secondary); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ts/ContentCard/__image_snapshots__/contentcard-android-chromium-dark-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...s/ContentCard/__image_snapshots__/contentcard-android-chromium-light-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...mponents/ContentCard/__image_snapshots__/contentcard-ios-webkit-dark-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ponents/ContentCard/__image_snapshots__/contentcard-ios-webkit-light-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ents/ContentCard/__image_snapshots__/contentcard-vkcom-chromium-dark-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...nts/ContentCard/__image_snapshots__/contentcard-vkcom-chromium-light-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...nents/ContentCard/__image_snapshots__/contentcard-vkcom-firefox-dark-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ents/ContentCard/__image_snapshots__/contentcard-vkcom-firefox-light-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...onents/ContentCard/__image_snapshots__/contentcard-vkcom-webkit-dark-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...nents/ContentCard/__image_snapshots__/contentcard-vkcom-webkit-light-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters