Does giving a large public donation for a masjid, where my name will be seen, cancel the reward compared to a quiet gift?
The reward of building a masjid is vast, and it does not vanish merely because human eyes fall upon your name. The Qur’an speaks of both ways of giving, the hidden and the seen, and promises a reward to both.
“Those who spend their wealth by night and by day, secretly and publicly, will have their reward with their Lord.”
Qur’an, Al-Baqarah 2:274 · meaning
Notice that Allah gathers them into a single verse, the one who gives by night and the one who gives by day, the one who gives in secret and the one who gives openly, and takes the reward of each upon Himself. That much this verse settles for you, and it is no small thing: a gift is not thrown away because it was seen.
Yet a few ayat earlier, in the very same passage about charity, Allah says something we should not quietly pass over, for it was said for our benefit and never against us. There He tells us that to disclose our charity is good, and that to conceal it and place it in the hands of the poor is better for us. So the Qur’an does lean toward the hidden hand, and the reason is itself in our favour: what no eye sees is safer for the heart, because no one can praise us for it and the self finds nothing there to feed on. Our elders loved the quiet gift for exactly this reason, and their love for it was never a reproach against the open one.
And here is where your own case becomes clear. That preference is spoken chiefly of the voluntary charity we slip into the hand of someone in need. Where the cause itself is public, as the building of a masjid is, and where one open hand moves ten other hands to open, the people of knowledge have long praised giving in the light, because such a gift raises two things at once, walls of stone and courage in other hearts. So in your situation neither way is the lesser way. Choose by what serves the masjid and what keeps your heart soft, and rest in this, that Allah has promised a reward to both.
Now consider what the Qur’an itself names as the real danger, for it names two things, and neither of them is a plaque upon a wall:
“O you who believe, do not nullify your charities with reminders of your generosity or with injury.”
Qur’an, Al-Baqarah 2:264 · meaning
Read this verse through to its end and you will find that it speaks of two ways a gift is hollowed out. It sets before us the one who spends his wealth in order to be seen by people, not believing in Allah and the Last Day, and it warns of reminders and injury. Let us be exact here, for the exact reading is also the more comforting one. What the verse condemns is spending for the sake of being seen, where the eyes of people are the very reason the hand opens. A gift given for Allah that then happens to be seen is quite another thing. And beside that stands the second danger, the quiet habit of reminding, of feeling that the community now owes you, of letting the giving swell the self rather than soften it.
So the question is not where your name sits, but where your reason sits. If the wall bearing your name were washed clean tomorrow and your heart would still be glad simply that the masjid stands, then your gift is where it should be. Guard your heart from that gentle drift into reminding, and your name upon the wall does you no harm at all.
There is no need, then, to tie yourself in knots choosing between the quiet gift and the public one. If giving privately keeps your heart most at rest, give privately. And if giving openly will encourage others and build the masjid sooner, give openly, and keep your heart low beneath the praise, saying inwardly that this was only ever His wealth passing through your hands back to Him.
One small step: Alongside your larger gift, set aside one small amount this week that no one but Allah will ever know about, and give it quietly.
