Skip to content

Commit

Permalink
Remove ternary usage from ru jobs (#349)
Browse files Browse the repository at this point in the history
## About The Pull Request
Убирает тернарник, который и длиннее альтернативы, и вносил бы изменения
в количество строк
  • Loading branch information
larentoun authored Jul 12, 2024
1 parent ef649bb commit 6a2d24b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
10 changes: 3 additions & 7 deletions tgui/packages/tgui/interfaces/JobSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ export const JobEntry = (data: {
<>
{jobIcon && <Icon name={jobIcon} />}
{job.command ? (
<b>{JOBS_RU[jobName] ? JOBS_RU[jobName] : jobName}</b>
) : JOBS_RU[jobName] ? (
JOBS_RU[jobName]
<b>{JOBS_RU[jobName] || jobName}</b>
) : (
jobName
JOBS_RU[jobName] || jobName
)}
<span
style={{
Expand Down Expand Up @@ -150,9 +148,7 @@ export const JobSelection = (props) => {
<StyleableSection
title={
<>
{DEPARTMENTS_RU[departmentName]
? DEPARTMENTS_RU[departmentName]
: departmentName}
{DEPARTMENTS_RU[departmentName] || departmentName}
<span
style={{
fontSize: '1rem',
Expand Down
6 changes: 1 addition & 5 deletions tgui/packages/tgui/interfaces/NtosCrewManifest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ export const NtosCrewManifest = (props) => {
<Section
key={department}
level={2}
title={
DEPARTMENTS_RU[department]
? DEPARTMENTS_RU[department]
: department
}
title={DEPARTMENTS_RU[department] || department}
>
<Table>
{entries.map((entry) => (
Expand Down
4 changes: 2 additions & 2 deletions tgui/packages/tgui/interfaces/PreferencesMenu/JobsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ const JobRow = (props: { className?: string; job: Job; name: string }) => {
paddingLeft: '0.3em',
}}
>
{JOBS_RU[name] ? JOBS_RU[name] : name}
{JOBS_RU[name] || name}
</Stack.Item>
</Tooltip>

Expand Down Expand Up @@ -318,7 +318,7 @@ const JoblessRoleDropdown = (props) => {

const options = [
{
displayText: `Присоединиться за ${JOBS_RU[data.overflow_role] ? JOBS_RU[data.overflow_role] : data.overflow_role} если не удалось войти`,
displayText: `Присоединиться за ${JOBS_RU[data.overflow_role] || data.overflow_role} если не удалось войти`,
value: JoblessRole.BeOverflow,
},
{
Expand Down

0 comments on commit 6a2d24b

Please sign in to comment.