Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Binary file added public/img/fox.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/squirrel.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/wolf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/locales/bg/beneficiary.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"company-select": "Изберете ЮЛНЦ или",
"create-new": "създайте нов",
"person-label": "Потребител",
"company-label": "ЮЛНЦ",
"company-label": "ЮЛНЦ"
}
},
"actions": "Действия",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/bg/campaign-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"allCampaignTypes": "Всички типове кампании",
"grid": {
"name": "Име",
"category": "Категория",
"category": "Категория: ",
"description": "Описание",
"no-parent": "Няма категория",
"no-description": "Няма описание"
Expand Down
1 change: 1 addition & 0 deletions public/locales/bg/campaigns.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"deleteTitle": "Сигурни ли сте?",
"deleteContent": "Това действие ще изтрие елемента завинаги!",
"actions": "Действия",
"toTheCampaignButton": "Към кампанията",
"statistics": {
"button": "Статистика за даренията",
"backButton": "Обратно към кампанията",
Expand Down
1 change: 1 addition & 0 deletions public/locales/bg/news.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"news": "Новини",
"all-news": "Всички новини",
"form-heading": "Създайте нова статия",
"edit-form-heading": "Редактирайте статия",
"read-more": "Прочети повече",
Expand Down
49 changes: 24 additions & 25 deletions public/locales/en/bank-transactions.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
{
"all": "All bank transactions",
"bank-transactions": "Bank transactions",
"transaction-date": "Transaction date",
"amount": "Amount",
"currency": "Currency",
"donation-status": "Donation status",
"id": "Trnsaction ID",
"bank-name": "Bank name",
"all": "All bank transactions",
"bank-transactions": "Bank transactions",
"transaction-date": "Transaction date",
"amount": "Amount",
"currency": "Currency",
"donation-status": "Donation status",
"id": "Trnsaction ID",
"bank-name": "Bank name",
"type": "Type",
"description": "Description",
"cta": {
"download": "Download",
"status": "Donation status",
"type": "Type",
"description": "Description",
"cta": {
"download": "Download",
"status": "Donation status",
"type": "Type",
"from": "From",
"to": "To",
"apply-ref-heading": "Apply ref heading",
"apply-ref": "Apply ref",
"edit": "Edit",
"start-sync": "Start sync"
},
"matched-ref": "Matched ref",
"payment-ref": "Payment ref",
"rerun-dates": "Repeat bank sync"
}

"from": "From",
"to": "To",
"apply-ref-heading": "Apply ref heading",
"apply-ref": "Apply ref",
"edit": "Edit",
"start-sync": "Start sync"
},
"matched-ref": "Matched ref",
"payment-ref": "Payment ref",
"rerun-dates": "Repeat bank sync"
}
16 changes: 16 additions & 0 deletions public/locales/en/campaigns.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"deleteTitle": "Are you sure you want to delete this campaign?",
"deleteContent": "This action cannot be undone.",
"actions": "Actions",
"toTheCampaignButton": "See the campaign",
"statistics": {
"button": "Donation statistics",
"backButton": "Go back",
Expand Down Expand Up @@ -89,6 +90,21 @@
"download": "Download",
"allow-donation-on-complete": "Allow donations after the amount is reached"
},
"subscribe": {
"confirm-sent": "Please, <bold>activate</bold> your subscription from the email that we sent to {{email}}",
"confirm-subscribe": "You subscribed successfully",
"subscribe-title": "Subscribe for news from Podkrepi.bg",
"subscribe-campaign-title": "Subscribe for news about the campaign",
"subscribe-text-nonLoggedUser": "Please, proceed as a guest and write down your email, on which you want to receive notifications for this campaign or you can log in. If you log in with your and password you will be able to manage your subscription from your Personal profile",
"subscribe-text-nonLoggedUser-general": "Please, proceed as a guest and write down your email, on which you want to receive notifications from us or you can log in. If you log in with your and password you will be able to manage your subscription from your Personal profile",
"subscribe-text-loggedUser": "Please, choose if you want to receive the news about the campaign on your profile email or on another one:",
"subscribe-subtitle": "I want to receive news and notifications from Podkrepi.bg on this email:",
"subscribe-campaign-subtTitle": "I want to receive news about the campaign on this email:",
"subscribe-button": "Subscribe me",
"profile-button": "On the profile one",
"another-button": "On another one",
"monthly-newsletter": "Monthly newsletter"
},
"campaign": {
"subheading": "Your support for the world matters. All supporters through Podkrepi.bg are our partners in supporting the community campaign. As a generous benefactor, you become an important partner in supporting a campaign regarding someone's health or the success of a cause that is close to your heart.",
"title": "Campaign name",
Expand Down
1 change: 1 addition & 0 deletions public/locales/en/news.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"news": "News",
"all-news": "All news",
"read-more": "Read more",
"form-heading": "Create new article",
"edit-form-heading": "Edit article",
Expand Down
34 changes: 17 additions & 17 deletions src/common/util/campaignImageUrls.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import getConfig from 'next/config'
import { CampaignFile, CampaignResponse } from 'gql/campaigns'
import { CampaignFile } from 'gql/campaigns'
import { CampaignFileRole, ImageSlider } from 'components/common/campaign-file/roles'

const { publicRuntimeConfig } = getConfig()
Expand All @@ -11,20 +11,20 @@ export function fileUrl(file: CampaignFile) {
/**
* Finds first file with given role
*/
function findFileWithRole(campaign: CampaignResponse, role: CampaignFileRole) {
return campaign?.campaignFiles?.find((file) => file.role == role)
function findFileWithRole(campaignFile: CampaignFile[], role: CampaignFileRole) {
return campaignFile?.find((file) => file.role == role)
}

/**
* Finds all files with given role
*/
function filterFilesWithRole(campaign: CampaignResponse, role: CampaignFileRole[]) {
return campaign.campaignFiles.filter((file) => role.includes(file.role))
function filterFilesWithRole(campaignFile: CampaignFile[], role: CampaignFileRole[]) {
return campaignFile.filter((file) => role.includes(file.role))
}

export function campaignSliderUrls(campaign: CampaignResponse): ImageSlider[] {
export function campaignSliderUrls(campaignFile: CampaignFile[]): ImageSlider[] {
const sliderImageRoles = [CampaignFileRole.campaignPhoto, CampaignFileRole.gallery]
const files = filterFilesWithRole(campaign, sliderImageRoles)
const files = filterFilesWithRole(campaignFile, sliderImageRoles)
const fileExtensionRemoverRegex = /.\w*$/
return files.map((file) => {
return {
Expand All @@ -35,27 +35,27 @@ export function campaignSliderUrls(campaign: CampaignResponse): ImageSlider[] {
})
}

export function campaignListPictureUrl(campaign: CampaignResponse): string {
const file = findFileWithRole(campaign, CampaignFileRole.campaignListPhoto)
export function campaignListPictureUrl(campaignFile: CampaignFile[]): string {
const file = findFileWithRole(campaignFile, CampaignFileRole.campaignListPhoto)
return file ? fileUrl(file) : '/podkrepi-icon.svg'
}

export function backgroundCampaignPictureUrl(campaign: CampaignResponse): string {
const file = findFileWithRole(campaign, CampaignFileRole.background)
export function backgroundCampaignPictureUrl(campaignFile: CampaignFile[]): string {
const file = findFileWithRole(campaignFile, CampaignFileRole.background)
return file ? fileUrl(file) : '/img/campaign-banner.png'
}

export function coordinatorCampaignPictureUrl(campaign: CampaignResponse): string {
const file = findFileWithRole(campaign, CampaignFileRole.coordinator)
export function coordinatorCampaignPictureUrl(campaignFile: CampaignFile[]): string {
const file = findFileWithRole(campaignFile, CampaignFileRole.coordinator)
return file ? fileUrl(file) : '/podkrepi-icon.png'
}

export function organizerCampaignPictureUrl(campaign: CampaignResponse): string {
const file = findFileWithRole(campaign, CampaignFileRole.organizerPhoto)
export function organizerCampaignPictureUrl(campaignFile: CampaignFile[]): string {
const file = findFileWithRole(campaignFile, CampaignFileRole.organizerPhoto)
return file ? fileUrl(file) : '/podkrepi-icon.png'
}

export function beneficiaryCampaignPictureUrl(campaign: CampaignResponse): string {
const file = findFileWithRole(campaign, CampaignFileRole.beneficiaryPhoto)
export function beneficiaryCampaignPictureUrl(campaignFile: CampaignFile[]): string {
const file = findFileWithRole(campaignFile, CampaignFileRole.beneficiaryPhoto)
return file ? fileUrl(file) : '/podkrepi-icon.png'
}
Loading